diff --git a/packages/google-cloud-securitycenter/.eslintignore b/packages/google-cloud-securitycenter/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-securitycenter/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-securitycenter/.eslintrc.json b/packages/google-cloud-securitycenter/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-securitycenter/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-securitycenter/.gitattributes b/packages/google-cloud-securitycenter/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-securitycenter/.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-securitycenter/.github/.OwlBot.yaml b/packages/google-cloud-securitycenter/.github/.OwlBot.yaml new file mode 100644 index 00000000000..0302714c19c --- /dev/null +++ b/packages/google-cloud-securitycenter/.github/.OwlBot.yaml @@ -0,0 +1,26 @@ +# 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/securitycenter/(v.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-securitycenter/.gitignore b/packages/google-cloud-securitycenter/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-securitycenter/.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-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js new file mode 100644 index 00000000000..3f4fcde553b --- /dev/null +++ b/packages/google-cloud-securitycenter/.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/security-center', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-securitycenter/.mocharc.js b/packages/google-cloud-securitycenter/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-cloud-securitycenter/.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-securitycenter/.nycrc b/packages/google-cloud-securitycenter/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-securitycenter/.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-securitycenter/.prettierignore b/packages/google-cloud-securitycenter/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-securitycenter/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-securitycenter/.prettierrc.js b/packages/google-cloud-securitycenter/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-cloud-securitycenter/.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-securitycenter/.readme-partials.yaml b/packages/google-cloud-securitycenter/.readme-partials.yaml new file mode 100644 index 00000000000..aab9d229cf5 --- /dev/null +++ b/packages/google-cloud-securitycenter/.readme-partials.yaml @@ -0,0 +1,10 @@ +introduction: |- + > Node.js idiomatic client for [Cloud Security Command Center][product-docs]. + + [Cloud Security Command Center](https://cloud.google.com/security-command-center/docs/) helps + security teams gather data, identify threats, and act on them before they result in business + damage or loss. It offers deep insight into application and data risk so that you can quickly + mitigate threats to your cloud resources and evaluate overall health. With Cloud Security + Command Center, you can view and monitor an inventory of your cloud assets, scan storage + systems for sensitive data, detect common web vulnerabilities, and review access rights + to your critical resources, all from a single, centralized dashboard. \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/.repo-metadata.json b/packages/google-cloud-securitycenter/.repo-metadata.json new file mode 100644 index 00000000000..c396871af1a --- /dev/null +++ b/packages/google-cloud-securitycenter/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "language": "nodejs", + "api_id": "securitycenter.googleapis.com", + "repo": "googleapis/nodejs-security-center", + "release_level": "stable", + "distribution_name": "@google-cloud/security-center", + "default_version": "v1", + "name": "security-center", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/security-center/latest", + "requires_billing": true, + "name_pretty": "Google Cloud Security Command Center", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559748", + "product_documentation": "https://cloud.google.com/security-command-center", + "api_shortname": "securitycenter", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md new file mode 100644 index 00000000000..5bb98a4cccb --- /dev/null +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -0,0 +1,543 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions + +## [7.0.0](https://github.com/googleapis/nodejs-security-center/compare/v6.3.1...v7.0.0) (2022-11-17) + + +### ⚠ BREAKING CHANGES + +* Add files field to finding's list of attributes (#515) + +### Features + +* Add files field to finding's list of attributes ([#515](https://github.com/googleapis/nodejs-security-center/issues/515)) ([dc37101](https://github.com/googleapis/nodejs-security-center/commit/dc37101f4d2bb86ffa5a554ce8537bcf912d3d31)) +* Added parent display name i.e. source display name for a finding as one of the finding attributes ([78f6033](https://github.com/googleapis/nodejs-security-center/commit/78f60334258c097ba7266fc89da14fa4972cfef9)) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#518](https://github.com/googleapis/nodejs-security-center/issues/518)) ([bd07a3f](https://github.com/googleapis/nodejs-security-center/commit/bd07a3fd5096642856c126fa7b7a62a48daae834)) +* Preserve default values in x-goog-request-params header ([#511](https://github.com/googleapis/nodejs-security-center/issues/511)) ([78f6033](https://github.com/googleapis/nodejs-security-center/commit/78f60334258c097ba7266fc89da14fa4972cfef9)) +* Regenerated protos JS and TS definitions ([#521](https://github.com/googleapis/nodejs-security-center/issues/521)) ([8969f05](https://github.com/googleapis/nodejs-security-center/commit/8969f058b475db04daa76f668fd64531a8379d10)) + +## [6.3.1](https://github.com/googleapis/nodejs-security-center/compare/v6.3.0...v6.3.1) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#506](https://github.com/googleapis/nodejs-security-center/issues/506)) ([22478d6](https://github.com/googleapis/nodejs-security-center/commit/22478d6fd89ec40aa281aa47daf14cfd96392341)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-security-center/issues/1553)) ([#507](https://github.com/googleapis/nodejs-security-center/issues/507)) ([fcea451](https://github.com/googleapis/nodejs-security-center/commit/fcea45122f431e6b1a1d680d960301b41f1eef39)) + +## [6.3.0](https://github.com/googleapis/nodejs-security-center/compare/v6.2.0...v6.3.0) (2022-08-23) + + +### Features + +* Adding uris to indicator of compromise (IOC) field ([bcf1a98](https://github.com/googleapis/nodejs-security-center/commit/bcf1a9875618b05830cbf787fb4676c92a3d2920)) + + +### Bug Fixes + +* better support for fallback mode ([#503](https://github.com/googleapis/nodejs-security-center/issues/503)) ([08f348c](https://github.com/googleapis/nodejs-security-center/commit/08f348ca11f4ef153201982280fc49e24a056e4c)) +* change import long to require ([#504](https://github.com/googleapis/nodejs-security-center/issues/504)) ([0eccdf0](https://github.com/googleapis/nodejs-security-center/commit/0eccdf080c75cf83ef4b2b5cd0b10dc98fd1596d)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-security-center/issues/1546)) ([#505](https://github.com/googleapis/nodejs-security-center/issues/505)) ([66a776b](https://github.com/googleapis/nodejs-security-center/commit/66a776b6e419c8d3980f126b98f7cb396e66cdca)) + +## [6.2.0](https://github.com/googleapis/nodejs-security-center/compare/v6.1.0...v6.2.0) (2022-07-29) + + +### Features + +* Added container field to findings attributes ([#499](https://github.com/googleapis/nodejs-security-center/issues/499)) ([4129598](https://github.com/googleapis/nodejs-security-center/commit/4129598a9b7e9a8975b7daa0d369ffcae9d25ae0)) + +## [6.1.0](https://github.com/googleapis/nodejs-security-center/compare/v6.0.0...v6.1.0) (2022-07-04) + + +### Features + +* Added contacts field to findings attributes, specifying Essential Contacts defined at org, folder or project level within a GCP org ([3937d33](https://github.com/googleapis/nodejs-security-center/commit/3937d335f081077364f52253e72d028389cd3602)) +* support regapic LRO ([#495](https://github.com/googleapis/nodejs-security-center/issues/495)) ([7bfc2bd](https://github.com/googleapis/nodejs-security-center/commit/7bfc2bd641078d5a3b46950d61d77bac3b1b077b)) + +## [6.0.0](https://github.com/googleapis/nodejs-security-center/compare/v5.11.0...v6.0.0) (2022-06-03) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#486) + +### Features + +* Add compliances, processes and exfiltration fields to findings attributes. They contain compliance information about a security standard indicating unmet recommendations, represents operating system processes, and data exfiltration attempt of one... ([#490](https://github.com/googleapis/nodejs-security-center/issues/490)) ([c825bb4](https://github.com/googleapis/nodejs-security-center/commit/c825bb42d8a9fcef8f256b25d8d47404895308c7)) + + +### Build System + +* update library to use Node 12 ([#486](https://github.com/googleapis/nodejs-security-center/issues/486)) ([eb30121](https://github.com/googleapis/nodejs-security-center/commit/eb3012173641734f6ac459560074aa91ffee02f7)) + +## [5.11.0](https://github.com/googleapis/nodejs-security-center/compare/v5.10.0...v5.11.0) (2022-05-06) + + +### Features + +* Add connection and description field to finding's list of attributes ([#479](https://github.com/googleapis/nodejs-security-center/issues/479)) ([fa705d9](https://github.com/googleapis/nodejs-security-center/commit/fa705d9e4fe41c64870480670b536a6640d5aa46)) + +## [5.10.0](https://github.com/googleapis/nodejs-security-center/compare/v5.9.0...v5.10.0) (2022-04-11) + + +### Features + +* Add iam_binding field to findings attributes. It represents particular IAM bindings, which captures a member's role addition, removal, or state ([#474](https://github.com/googleapis/nodejs-security-center/issues/474)) ([b29893c](https://github.com/googleapis/nodejs-security-center/commit/b29893c112a346a3277620a01e5ce391097f3c40)) +* Add next_steps field to finding's list of attributes ([#476](https://github.com/googleapis/nodejs-security-center/issues/476)) ([326e8d2](https://github.com/googleapis/nodejs-security-center/commit/326e8d2242d0852df593474dbc028ea17fb8d600)) +* AuditConfig for IAM v1 ([#470](https://github.com/googleapis/nodejs-security-center/issues/470)) ([2ec070f](https://github.com/googleapis/nodejs-security-center/commit/2ec070f504fe85bd1c9adf7436b7d8c902ec167b)) + +## [5.9.0](https://github.com/googleapis/nodejs-security-center/compare/v5.8.0...v5.9.0) (2022-02-04) + + +### Features + +* Release the access field in the v1 finding proto, which represents an access event tied to the finding ([6bbb738](https://github.com/googleapis/nodejs-security-center/commit/6bbb73850a1ed0ee3481ddbdc55c52e7bfa8fc0f)) +* Release the access field in the v1 finding proto, which represents an access event tied to the finding docs: added more clarification around what event_time means on a v1 finding ([#457](https://github.com/googleapis/nodejs-security-center/issues/457)) ([6bbb738](https://github.com/googleapis/nodejs-security-center/commit/6bbb73850a1ed0ee3481ddbdc55c52e7bfa8fc0f)) + +## [5.8.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.7.0...v5.8.0) (2021-11-22) + + +### Features + +* Added a new API method UpdateExternalSystem, which enables updating a finding w/ external system metadata. External systems are a child resource under finding, and are housed on the finding itself, and can also be filtered on in Notifications, the ListFindings and GroupFindings API ([3917f97](https://www.github.com/googleapis/nodejs-security-center/commit/3917f978d8d645d08024d28c7045a4d5481782dd)) + +## [5.7.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.6.0...v5.7.0) (2021-11-15) + + +### Features + +* Added mute related APIs, proto messages and fields ([#438](https://www.github.com/googleapis/nodejs-security-center/issues/438)) ([d432649](https://www.github.com/googleapis/nodejs-security-center/commit/d432649fed31f92a6048769b6b889666f5b9cced)) + +## [5.6.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.5.1...v5.6.0) (2021-10-14) + + +### Features + +* Added type field to the resource which is surfaced in NotificationMessage ([#428](https://www.github.com/googleapis/nodejs-security-center/issues/428)) ([924aaec](https://www.github.com/googleapis/nodejs-security-center/commit/924aaec714aec659a2cff0c995a00a9a269ca9d6)) +* Added vulnerability field to the finding ([924aaec](https://www.github.com/googleapis/nodejs-security-center/commit/924aaec714aec659a2cff0c995a00a9a269ca9d6)) + +### [5.5.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.5.0...v5.5.1) (2021-09-10) + + +### Bug Fixes + +* **build:** set default branch to main ([#420](https://www.github.com/googleapis/nodejs-security-center/issues/420)) ([7a04895](https://www.github.com/googleapis/nodejs-security-center/commit/7a04895d15fc51694aba186bfbffaf7495744937)) + +## [5.5.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.4.1...v5.5.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#417](https://www.github.com/googleapis/nodejs-security-center/issues/417)) ([ec4b179](https://www.github.com/googleapis/nodejs-security-center/commit/ec4b17916d42f9ff006b9c9d0c1a6c2dd0743fa7)) + +### [5.4.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.4.0...v5.4.1) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#415](https://www.github.com/googleapis/nodejs-security-center/issues/415)) ([aa77ac3](https://www.github.com/googleapis/nodejs-security-center/commit/aa77ac33ed9e20e75505fb4d31183a0f1f0d1f76)) + +## [5.4.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.5...v5.4.0) (2021-07-30) + + +### Features + +* add finding_class and indicator fields in Finding ([#409](https://www.github.com/googleapis/nodejs-security-center/issues/409)) ([d0abd01](https://www.github.com/googleapis/nodejs-security-center/commit/d0abd013b359b1876c16e7f4ee6b8c873acc5014)) + +### [5.3.5](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.4...v5.3.5) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#405](https://www.github.com/googleapis/nodejs-security-center/issues/405)) ([91dacef](https://www.github.com/googleapis/nodejs-security-center/commit/91dacef6d656cf1cd41803b337524c417498de1e)) + +### [5.3.4](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.3...v5.3.4) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#403](https://www.github.com/googleapis/nodejs-security-center/issues/403)) ([5bc78fb](https://www.github.com/googleapis/nodejs-security-center/commit/5bc78fbd4b038320032d8905af064a42d62e0c2f)) + +### [5.3.3](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.2...v5.3.3) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#400](https://www.github.com/googleapis/nodejs-security-center/issues/400)) ([0f35393](https://www.github.com/googleapis/nodejs-security-center/commit/0f35393b8e64fdabc170eb264de5e5a54a0c6f2e)) + +### [5.3.2](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.1...v5.3.2) (2021-06-25) + + +### Bug Fixes + +* make request optional in all cases ([#396](https://www.github.com/googleapis/nodejs-security-center/issues/396)) ([871b0d3](https://www.github.com/googleapis/nodejs-security-center/commit/871b0d3c26878f1a836ec186fb66be08073ed899)) + +### [5.3.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.3.0...v5.3.1) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#385](https://www.github.com/googleapis/nodejs-security-center/issues/385)) ([7faea1b](https://www.github.com/googleapis/nodejs-security-center/commit/7faea1b6670b96cf26d9bbc6d18a58b868627c60)) + +## [5.3.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.2.0...v5.3.0) (2021-05-12) + + +### Features + +* **v1:** add canonical_name and folder fields ([#379](https://www.github.com/googleapis/nodejs-security-center/issues/379)) ([239901b](https://www.github.com/googleapis/nodejs-security-center/commit/239901ba42e5973024c86728013354cd4731a0ee)) +* **v1p1beta1:** add canonical_name and folder fields ([#378](https://www.github.com/googleapis/nodejs-security-center/issues/378)) ([5354f52](https://www.github.com/googleapis/nodejs-security-center/commit/5354f52df024d465b224c9db20e0c9cd9586060b)) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#373](https://www.github.com/googleapis/nodejs-security-center/issues/373)) ([c13a77a](https://www.github.com/googleapis/nodejs-security-center/commit/c13a77aa4340e63cc4c32b01463c2a761bef2f1f)) +* use require() to load JSON protos ([#376](https://www.github.com/googleapis/nodejs-security-center/issues/376)) ([efac58d](https://www.github.com/googleapis/nodejs-security-center/commit/efac58d6a49a68598703e8b7a7c7c235894c525f)) + +## [5.2.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.1.3...v5.2.0) (2021-01-07) + + +### Features + +* added field severity to findings in v1 API ([#349](https://www.github.com/googleapis/nodejs-security-center/issues/349)) ([79f1433](https://www.github.com/googleapis/nodejs-security-center/commit/79f1433d05037d1bb9f7d0a252cb483a0f817568)) +* introduces style enumeration ([#353](https://www.github.com/googleapis/nodejs-security-center/issues/353)) ([37c179f](https://www.github.com/googleapis/nodejs-security-center/commit/37c179f8915d7b5f6e141b78e59ec612b6b115a7)) + +### [5.1.3](https://www.github.com/googleapis/nodejs-security-center/compare/v5.1.2...v5.1.3) (2020-11-25) + + +### Bug Fixes + +* check for fetch on window ([#344](https://www.github.com/googleapis/nodejs-security-center/issues/344)) ([85c6d55](https://www.github.com/googleapis/nodejs-security-center/commit/85c6d55fa245fb2508423d2f0ba94f2e1c25c53f)) + +### [5.1.2](https://www.github.com/googleapis/nodejs-security-center/compare/v5.1.1...v5.1.2) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#337](https://www.github.com/googleapis/nodejs-security-center/issues/337)) ([2792fc8](https://www.github.com/googleapis/nodejs-security-center/commit/2792fc829c6db2fbbd951df4739b8d1524243012)) + +### [5.1.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.1.0...v5.1.1) (2020-08-17) + + +### Bug Fixes + +* **deps:** roll back dependency @google-cloud/security-center to ^5.0.3 ([#319](https://www.github.com/googleapis/nodejs-security-center/issues/319)) ([f3462e1](https://www.github.com/googleapis/nodejs-security-center/commit/f3462e16aacb42f66f50ca4205a58981d2540686)) + +## [5.1.0](https://www.github.com/googleapis/nodejs-security-center/compare/v5.0.3...v5.1.0) (2020-08-14) + + +### Features + +* added field severity to findings ([#317](https://www.github.com/googleapis/nodejs-security-center/issues/317)) ([155a14a](https://www.github.com/googleapis/nodejs-security-center/commit/155a14a714304be6916452c32aee833aa5fe4230)) + +### [5.0.3](https://www.github.com/googleapis/nodejs-security-center/compare/v5.0.2...v5.0.3) (2020-07-30) + + +### Bug Fixes + +* **deps:** roll back dependency @google-cloud/security-center to ^5.0.1 ([#309](https://www.github.com/googleapis/nodejs-security-center/issues/309)) ([f68400c](https://www.github.com/googleapis/nodejs-security-center/commit/f68400c4490a6887bb8578184b4737a678da47d7)) + +### [5.0.2](https://www.github.com/googleapis/nodejs-security-center/compare/v5.0.1...v5.0.2) (2020-07-27) + + +### Bug Fixes + +* add resource config to v1beta1 ([#307](https://www.github.com/googleapis/nodejs-security-center/issues/307)) ([5d99acf](https://www.github.com/googleapis/nodejs-security-center/commit/5d99acf9dea7a6e2d384ee709678365c769f3d6e)) +* correct securitycenter grpc_service_configs, add Node 8 tests ([#302](https://www.github.com/googleapis/nodejs-security-center/issues/302)) ([4e4ec5b](https://www.github.com/googleapis/nodejs-security-center/commit/4e4ec5bbd9623dc952781e80da226320db3906af)) + +### [5.0.1](https://www.github.com/googleapis/nodejs-security-center/compare/v5.0.0...v5.0.1) (2020-07-06) + + +### Bug Fixes + +* update node issue template ([#290](https://www.github.com/googleapis/nodejs-security-center/issues/290)) ([c0b8bad](https://www.github.com/googleapis/nodejs-security-center/commit/c0b8bad200f829aa62ee7430bf0d51b5463c92ca)) + +## [5.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v4.0.0...v5.0.0) (2020-06-15) + + +### ⚠ BREAKING CHANGES + +* Removed 'having' as a field in the List and Group Finding and Asset requests. + +### Features + +* add Resource to the v1 NotificationMessage, update protos ([#286](https://www.github.com/googleapis/nodejs-security-center/issues/286)) ([f810e5e](https://www.github.com/googleapis/nodejs-security-center/commit/f810e5e9f0791050616273f06bebc3ea05617e7f)) + + +### Bug Fixes + +* handle fallback option properly ([#284](https://www.github.com/googleapis/nodejs-security-center/issues/284)) ([f714260](https://www.github.com/googleapis/nodejs-security-center/commit/f71426053da4eb2416ebd593862e89c0d5557827)) + +## [4.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v3.1.0...v4.0.0) (2020-06-04) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. + +### Features + +* check status of long running operation by its name ([#273](https://www.github.com/googleapis/nodejs-security-center/issues/273)) ([dd0f4d1](https://www.github.com/googleapis/nodejs-security-center/commit/dd0f4d1866ec61e37392c79cf7f148e339d04d1b)) +* drop node8 support, support for async iterators ([#248](https://www.github.com/googleapis/nodejs-security-center/issues/248)) ([686f741](https://www.github.com/googleapis/nodejs-security-center/commit/686f7418517e6d827bfcbe483d7b1bb014385e10)) + + +### Bug Fixes + +* export explicit version from protos.js ([#253](https://www.github.com/googleapis/nodejs-security-center/issues/253)) ([aa62575](https://www.github.com/googleapis/nodejs-security-center/commit/aa6257554e5b401ba7b7613f0bf78d6233ef300b)) +* remove eslint, update gax, fix generated protos, run the generator ([#258](https://www.github.com/googleapis/nodejs-security-center/issues/258)) ([38e64d7](https://www.github.com/googleapis/nodejs-security-center/commit/38e64d77317870caa81122fa2a9c449dcbe714e0)) +* synth.py clean up for multiple version ([#274](https://www.github.com/googleapis/nodejs-security-center/issues/274)) ([e50061a](https://www.github.com/googleapis/nodejs-security-center/commit/e50061a5f834a356b0221ff01d8de4ed02089260)) +* **deps:** update dependency @google-cloud/pubsub to v2 ([#276](https://www.github.com/googleapis/nodejs-security-center/issues/276)) ([6ce252e](https://www.github.com/googleapis/nodejs-security-center/commit/6ce252eb770d1a4304301bfbaeacb9d165f8a3e9)) + +## [3.1.0](https://www.github.com/googleapis/nodejs-security-center/compare/v3.0.1...v3.1.0) (2020-03-06) + + +### Features + +* deferred client initialization ([#230](https://www.github.com/googleapis/nodejs-security-center/issues/230)) ([e6ee806](https://www.github.com/googleapis/nodejs-security-center/commit/e6ee8064285adfb64666dd976da401a123c0d8a1)) +* export protos in src/index.ts ([f3b2f47](https://www.github.com/googleapis/nodejs-security-center/commit/f3b2f477aa0af4d3f5a5c1d3b191643986f1c48b)) + + +### Bug Fixes + +* updated timeout in service config ([280cba4](https://www.github.com/googleapis/nodejs-security-center/commit/280cba439c681fcf7be0b936f052ebdaf215c850)) + +### [3.0.1](https://www.github.com/googleapis/nodejs-security-center/compare/v3.0.0...v3.0.1) (2020-02-07) + + +### Bug Fixes + +* pass x-goog-request-params header for streaming calls ([c73e1b6](https://www.github.com/googleapis/nodejs-security-center/commit/c73e1b688367377a2c879d3ad9b000b91588dcd3)) + +## [3.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v2.3.2...v3.0.0) (2020-02-05) + + +### ⚠ BREAKING CHANGES + +* convert library to TypeScript, adding v1p1beta1 import (#198) + +### Features + +* convert library to TypeScript, adding v1p1beta1 import ([#198](https://www.github.com/googleapis/nodejs-security-center/issues/198)) ([0adb7d0](https://www.github.com/googleapis/nodejs-security-center/commit/0adb7d0ea27a07ba0ad0ee235ddfde1f44cd3c24)) + +### [2.3.2](https://www.github.com/googleapis/nodejs-security-center/compare/v2.3.1...v2.3.2) (2020-01-28) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([be83dd6](https://www.github.com/googleapis/nodejs-security-center/commit/be83dd689fa51bd1dd0acce63a144e195a1b7688)) + +### [2.3.1](https://www.github.com/googleapis/nodejs-security-center/compare/v2.3.0...v2.3.1) (2020-01-05) + + +### Bug Fixes + +* proto files updated with proto annotations ([#182](https://www.github.com/googleapis/nodejs-security-center/issues/182)) ([010f3de](https://www.github.com/googleapis/nodejs-security-center/commit/010f3de382300787a3e383d5c55ec1f0dcc2536a)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-security-center/compare/v2.2.2...v2.3.0) (2019-12-10) + + +### Features + +* support resource descriptors ([#174](https://www.github.com/googleapis/nodejs-security-center/issues/174)) ([a55b223](https://www.github.com/googleapis/nodejs-security-center/commit/a55b2232a821ddcbe1132eab2f1e5873bc5e96f2)) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([121d969](https://www.github.com/googleapis/nodejs-security-center/commit/121d9696bcc9453d497a53e40c4679a63793673c)) + +### [2.2.2](https://www.github.com/googleapis/nodejs-security-center/compare/v2.2.1...v2.2.2) (2019-11-15) + + +### Bug Fixes + +* import long into proto ts declaration file ([#167](https://www.github.com/googleapis/nodejs-security-center/issues/167)) ([8548ae2](https://www.github.com/googleapis/nodejs-security-center/commit/8548ae2d620a690dcaa2f270c35c91745c37329f)) +* **docs:** bump release level to GA ([#171](https://www.github.com/googleapis/nodejs-security-center/issues/171)) ([8169088](https://www.github.com/googleapis/nodejs-security-center/commit/81690887c934e3a06ca82dd8850d47a74e4ad1c9)) +* **docs:** snippets are now replaced in jsdoc comments ([#166](https://www.github.com/googleapis/nodejs-security-center/issues/166)) ([c2d6f93](https://www.github.com/googleapis/nodejs-security-center/commit/c2d6f93c360bcb44ac095dea23c3191f3d5a4e2b)) + +### [2.2.1](https://www.github.com/googleapis/nodejs-security-center/compare/v2.2.0...v2.2.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#158](https://www.github.com/googleapis/nodejs-security-center/issues/158)) ([16d27c8](https://www.github.com/googleapis/nodejs-security-center/commit/16d27c87ce951546163dd1e8a16e57daf2877093)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-security-center/compare/v2.1.0...v2.2.0) (2019-10-09) + + +### Bug Fixes + +* use compatible version of google-gax ([e85bac4](https://www.github.com/googleapis/nodejs-security-center/commit/e85bac4)) + + +### Features + +* .d.ts for protos ([#148](https://www.github.com/googleapis/nodejs-security-center/issues/148)) ([f10a7ab](https://www.github.com/googleapis/nodejs-security-center/commit/f10a7ab)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-security-center/compare/v2.0.1...v2.1.0) (2019-09-06) + + +### Bug Fixes + +* include the correct version of node in a header ([#138](https://www.github.com/googleapis/nodejs-security-center/issues/138)) ([4b42390](https://www.github.com/googleapis/nodejs-security-center/commit/4b42390)) + + +### Features + +* load protos from JSON, grpc-fallback support ([#142](https://www.github.com/googleapis/nodejs-security-center/issues/142)) ([570cca4](https://www.github.com/googleapis/nodejs-security-center/commit/570cca4)) + +### [2.0.1](https://www.github.com/googleapis/nodejs-security-center/compare/v2.0.0...v2.0.1) (2019-08-05) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([63e4855](https://www.github.com/googleapis/nodejs-security-center/commit/63e4855)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v1.0.0...v2.0.0) (2019-07-23) + + +### ⚠ BREAKING CHANGES + +* adds findingSecurityMarksPathTemplate (#122) + +### Bug Fixes + +* **deps:** remove unused dependency ([#126](https://www.github.com/googleapis/nodejs-security-center/issues/126)) ([2c606ea](https://www.github.com/googleapis/nodejs-security-center/commit/2c606ea)) + + +### Features + +* adds findingSecurityMarksPathTemplate ([#122](https://www.github.com/googleapis/nodejs-security-center/issues/122)) ([3070f29](https://www.github.com/googleapis/nodejs-security-center/commit/3070f29)) + +## [1.0.0](https://www.github.com/googleapis/nodejs-security-center/compare/v0.3.0...v1.0.0) (2019-07-02) + + +### ⚠ BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#93) + +### Bug Fixes + +* **deps:** update dependency google-gax to ^0.26.0 ([#91](https://www.github.com/googleapis/nodejs-security-center/issues/91)) ([b4708af](https://www.github.com/googleapis/nodejs-security-center/commit/b4708af)) +* **deps:** update dependency google-gax to v1 ([#100](https://www.github.com/googleapis/nodejs-security-center/issues/100)) ([10e455c](https://www.github.com/googleapis/nodejs-security-center/commit/10e455c)) +* drop dependency on lodash.merge ([#105](https://www.github.com/googleapis/nodejs-security-center/issues/105)) ([093822e](https://www.github.com/googleapis/nodejs-security-center/commit/093822e)) +* **docs:** link to reference docs section on googleapis.dev ([#117](https://www.github.com/googleapis/nodejs-security-center/issues/117)) ([df786bf](https://www.github.com/googleapis/nodejs-security-center/commit/df786bf)) +* **docs:** move to new client docs URL ([#114](https://www.github.com/googleapis/nodejs-security-center/issues/114)) ([c8e406e](https://www.github.com/googleapis/nodejs-security-center/commit/c8e406e)) +* import run_asset_discovery_response.proto ([#119](https://www.github.com/googleapis/nodejs-security-center/issues/119)) ([8fed12f](https://www.github.com/googleapis/nodejs-security-center/commit/8fed12f)) +* include 'x-goog-request-params' header in requests ([#77](https://www.github.com/googleapis/nodejs-security-center/issues/77)) ([2556bb7](https://www.github.com/googleapis/nodejs-security-center/commit/2556bb7)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#93](https://www.github.com/googleapis/nodejs-security-center/issues/93)) ([3714719](https://www.github.com/googleapis/nodejs-security-center/commit/3714719)) + + +### Features + +* asset path template & matchers ([#84](https://www.github.com/googleapis/nodejs-security-center/issues/84)) ([3c4bc9a](https://www.github.com/googleapis/nodejs-security-center/commit/3c4bc9a)) +* support apiEndpoint override in client constructor ([#112](https://www.github.com/googleapis/nodejs-security-center/issues/112)) ([58ddc40](https://www.github.com/googleapis/nodejs-security-center/commit/58ddc40)) + +## v0.3.0 + +03-14-2019 07:55 PDT + +**This release has breaking changes!** The `having` enum value from `GroupFindingsRequest` has been removed. This field was not supposed to be exposed. + +### Bug Fixes +- fix: remove the `having` enum value from `GroupFindingsRequest` ([#67](https://github.com/googleapis/nodejs-security-center/pull/67)) + +### Documentation +- docs: use backticks for JS values + +## v0.2.0 + +03-12-2019 16:11 PDT + +### New Features +- feat: add v1 variant of the API ([#61](https://github.com/googleapis/nodejs-security-center/pull/61)) + +### Bug Fixes +- fix: throw on invalid credentials + +### Dependencies +- fix(deps): update dependency google-gax to ^0.25.0 ([#42](https://github.com/googleapis/nodejs-security-center/pull/42)) + +### Documentation +- docs: update examples +- docs: update comments on protos ([#56](https://github.com/googleapis/nodejs-security-center/pull/56)) +- docs: sync latest proto docs +- docs: update links in contrib guide ([#53](https://github.com/googleapis/nodejs-security-center/pull/53)) +- docs: update contributing path in README ([#48](https://github.com/googleapis/nodejs-security-center/pull/48)) +- docs: move CONTRIBUTING.md to root ([#47](https://github.com/googleapis/nodejs-security-center/pull/47)) +- docs: add lint/fix example to contributing guide ([#45](https://github.com/googleapis/nodejs-security-center/pull/45)) +- docs: fix example comments ([#44](https://github.com/googleapis/nodejs-security-center/pull/44)) + +### Internal / Testing Changes +- build: Add docuploader credentials to node publish jobs ([#59](https://github.com/googleapis/nodejs-security-center/pull/59)) +- build: use node10 to run samples-test, system-test etc ([#58](https://github.com/googleapis/nodejs-security-center/pull/58)) +- build: update release configuration +- chore(deps): update dependency mocha to v6 +- build: use linkinator for docs test ([#52](https://github.com/googleapis/nodejs-security-center/pull/52)) +- build: create docs test npm scripts ([#50](https://github.com/googleapis/nodejs-security-center/pull/50)) +- build: test using @grpc/grpc-js in CI ([#49](https://github.com/googleapis/nodejs-security-center/pull/49)) +- refactor: improve generated code style. ([#43](https://github.com/googleapis/nodejs-security-center/pull/43)) +- chore(deps): update dependency eslint-config-prettier to v4 ([#41](https://github.com/googleapis/nodejs-security-center/pull/41)) +- build: ignore googleapis.com in doc link check ([#39](https://github.com/googleapis/nodejs-security-center/pull/39)) +- chore: sync gapic files + +## v0.1.2 + +01-16-2019 16:03 PST + +### Dependencies +- fix(deps): update dependency google-gax to ^0.23.0 ([#34](https://github.com/googleapis/nodejs-security-center/pull/34)) + +### Documentation +- docs: update jsdoc comments ([#36](https://github.com/googleapis/nodejs-security-center/pull/36)) +- build: check broken links in generated docs ([#25](https://github.com/googleapis/nodejs-security-center/pull/25)) +- docs: various doc changes in protos and generated source ([#31](https://github.com/googleapis/nodejs-security-center/pull/31)) +- fix(docs): broken link to API ref docs ([#32](https://github.com/googleapis/nodejs-security-center/pull/32)) +- docs: update the comments in the protos ([#30](https://github.com/googleapis/nodejs-security-center/pull/30)) +- samples: add quickstart ([#33](https://github.com/googleapis/nodejs-security-center/pull/33)) + +## v0.1.1 + +01-02-2019 14:54 PST + +### Documentation +- fix(docs): require stmt (#29) +- add missing namespaces ([#27](https://github.com/googleapis/nodejs-security-center/pull/27)) +- fix(docs): fix require module in samples ([#26](https://github.com/googleapis/nodejs-security-center/pull/26)) + +### Internal / Testing Changes +- chore(build): inject yoshi automation key ([#23](https://github.com/googleapis/nodejs-security-center/pull/23)) +- chore: update nyc and eslint configs ([#22](https://github.com/googleapis/nodejs-security-center/pull/22)) +- chore: fix publish.sh permission +x ([#20](https://github.com/googleapis/nodejs-security-center/pull/20)) +- fix(build): fix Kokoro release script ([#19](https://github.com/googleapis/nodejs-security-center/pull/19)) +- build: add Kokoro configs for autorelease ([#18](https://github.com/googleapis/nodejs-security-center/pull/18)) +- chore: add synth.metadata ([#17](https://github.com/googleapis/nodejs-security-center/pull/17)) +- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 ([#12](https://github.com/googleapis/nodejs-security-center/pull/12)) +- chore: always nyc report before calling codecov ([#15](https://github.com/googleapis/nodejs-security-center/pull/15)) +- chore: nyc ignore build/test by default ([#14](https://github.com/googleapis/nodejs-security-center/pull/14)) +- docs: update readme badges ([#11](https://github.com/googleapis/nodejs-security-center/pull/11)) + +## v0.1.0 + +This is the initial release of the Cloud Security Center API Node.js client library. + +### Documentation +- docs: sync protos comment changes + +### Internal / Testing Changes +- build: add encrypted key ([#8](https://github.com/googleapis/nodejs-security-center/pull/8)) +- add dummy no test yet file to system test and samples test dirs +- chore(build): Configure Renovate ([#6](https://github.com/googleapis/nodejs-security-center/pull/6)) +- fix(build): fix system key decryption ([#5](https://github.com/googleapis/nodejs-security-center/pull/5)) +- refactor: fix lint rules and make consistent ([#1](https://github.com/googleapis/nodejs-security-center/pull/1)) +- remove CONTRIBUTORS +- license header on npm-install-retry +- add more scaffolding diff --git a/packages/google-cloud-securitycenter/CODE_OF_CONDUCT.md b/packages/google-cloud-securitycenter/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-securitycenter/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-securitycenter/CONTRIBUTING.md b/packages/google-cloud-securitycenter/CONTRIBUTING.md new file mode 100644 index 00000000000..18cf8c0b149 --- /dev/null +++ b/packages/google-cloud-securitycenter/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 Google Cloud Security Command Center 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=securitycenter.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/LICENSE b/packages/google-cloud-securitycenter/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-securitycenter/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-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md new file mode 100644 index 00000000000..f524eceeebf --- /dev/null +++ b/packages/google-cloud-securitycenter/README.md @@ -0,0 +1,166 @@ +[//]: # "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 + +# [Google Cloud Security Command Center: Node.js Client](https://github.com/googleapis/nodejs-security-center) + +[![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/security-center.svg)](https://www.npmjs.org/package/@google-cloud/security-center) + + + + +> Node.js idiomatic client for [Cloud Security Command Center][product-docs]. + +[Cloud Security Command Center](https://cloud.google.com/security-command-center/docs/) helps +security teams gather data, identify threats, and act on them before they result in business +damage or loss. It offers deep insight into application and data risk so that you can quickly +mitigate threats to your cloud resources and evaluate overall health. With Cloud Security +Command Center, you can view and monitor an inventory of your cloud assets, scan storage +systems for sensitive data, detect common web vulnerabilities, and review access rights +to your critical resources, all from a single, centralized dashboard. + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-security-center/blob/main/CHANGELOG.md). + +* [Google Cloud Security Command Center Node.js Client API Reference][client-docs] +* [Google Cloud Security Command Center Documentation][product-docs] +* [github.com/googleapis/nodejs-security-center](https://github.com/googleapis/nodejs-security-center) + +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 Google Cloud Security Command Center 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/security-center +``` + + +### Using the client library + +```javascript +const sc = require('@google-cloud/security-center'); + +// Create a client +const client = new sc.SecurityCenterClient(); + +async function quickstart() { + // TODO(developer): choose the organization to use + // const organization = 'your-organization'; + const [source] = await client.createSource({ + parent: client.organizationPath(organization), + source: {}, + }); + // The newly created source. + console.log('Source created.'); + console.log(source); +} +quickstart(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-security-center/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-security-center/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-security-center&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + + + +The [Google Cloud Security Command Center 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/security-center@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-security-center/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-security-center/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/security-center/latest +[product-docs]: https://cloud.google.com/security-command-center +[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=securitycenter.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-securitycenter/linkinator.config.json b/packages/google-cloud-securitycenter/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-securitycenter/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-securitycenter/owlbot.py b/packages/google-cloud-securitycenter/owlbot.py new file mode 100644 index 00000000000..c9485321fc1 --- /dev/null +++ b/packages/google-cloud-securitycenter/owlbot.py @@ -0,0 +1,20 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# 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 synthtool.languages.node as node + +node.owlbot_main( + staging_excludes=['package.json', 'README.md'], + templates_excludes=['.kokoro/samples-test.sh', '.kokoro/samples-test.sh'] +) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json new file mode 100644 index 00000000000..4fabb446684 --- /dev/null +++ b/packages/google-cloud-securitycenter/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/security-center", + "description": "Cloud Security Command Center API client for Node.js", + "version": "7.0.0", + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "repository": "googleapis/nodejs-security-center", + "files": [ + "build/src", + "build/protos" + ], + "main": "build/src/index.js", + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "docs": "jsdoc -c .jsdoc.js", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "predocs-test": "npm run docs", + "prepare": "npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google security center", + "Security Center", + "Security Command Center API" + ], + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.0.0", + "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.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^8.0.0", + "typescript": "^4.6.4" + } +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/common_resources.proto b/packages/google-cloud-securitycenter/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto new file mode 100644 index 00000000000..799b84fcccb --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto @@ -0,0 +1,100 @@ +// 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "AccessProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents an access event. +message Access { + // Associated email, such as "foo@google.com". + // + // The email address of the authenticated user (or service account on behalf + // of third party principal) making the request. For third party identity + // callers, the `principal_subject` field is populated instead of this field. + // For privacy reasons, the principal email address is sometimes redacted. + // For more information, see [Caller identities in audit + // logs](https://cloud.google.com/logging/docs/audit#user-id). + string principal_email = 1; + + // Caller's IP address, such as "1.1.1.1". + string caller_ip = 2; + + // The caller IP's geolocation, which identifies where the call came from. + Geolocation caller_ip_geo = 3; + + // What kind of user agent is associated, e.g. operating system shells, + // embedded or stand-alone applications, etc. + string user_agent_family = 4; + + // This is the API service that the service account made a call to, e.g. + // "iam.googleapis.com" + string service_name = 5; + + // The method that the service account called, e.g. "SetIamPolicy". + string method_name = 6; + + // A string representing the principal_subject associated with the identity. + // As compared to `principal_email`, supports principals that aren't + // associated with email addresses, such as third party principals. For most + // identities, the format will be `principal://iam.googleapis.com/{identity + // pool name}/subjects/{subject}` except for some GKE identities + // (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy + // format `serviceAccount:{identity pool name}[{subject}]` + string principal_subject = 7; + + // The name of the service account key used to create or exchange + // credentials for authenticating the service account making the request. + // This is a scheme-less URI full resource name. For example: + // + // "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}" + // + string service_account_key_name = 8; + + // Identity delegation history of an authenticated service account that makes + // the request. It contains information on the real authorities that try to + // access GCP resources by delegating on a service account. When multiple + // authorities are present, they are guaranteed to be sorted based on the + // original ordering of the identity delegation events. + repeated ServiceAccountDelegationInfo service_account_delegation_info = 9; +} + +// Identity delegation history of an authenticated service account. +message ServiceAccountDelegationInfo { + // The email address of a Google account. + string principal_email = 1; + + // A string representing the principal_subject associated with the identity. + // As compared to `principal_email`, supports principals that aren't + // associated with email addresses, such as third party principals. For most + // identities, the format will be `principal://iam.googleapis.com/{identity + // pool name}/subjects/{subject}` except for some GKE identities + // (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy + // format `serviceAccount:{identity pool name}[{subject}]` + string principal_subject = 2; +} + +// Represents a geographical location for a given access. +message Geolocation { + // A CLDR. + string region_code = 1; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto new file mode 100644 index 00000000000..55ba5641a09 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto @@ -0,0 +1,134 @@ +// 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.securitycenter.v1; + +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1/folder.proto"; +import "google/cloud/securitycenter/v1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Security Command Center representation of a Google Cloud +// resource. +// +// The Asset is a Security Command Center resource that captures information +// about a single Google Cloud resource. All modifications to an Asset are only +// within the context of Security Command Center and don't affect the referenced +// Google Cloud resource. +message Asset { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Asset" + pattern: "organizations/{organization}/assets/{asset}" + pattern: "folders/{folder}/assets/{asset}" + pattern: "projects/{project}/assets/{asset}" + }; + + // Security Command Center managed properties. These properties are managed by + // Security Command Center and cannot be modified by the user. + message SecurityCenterProperties { + // The full resource name of the Google Cloud resource this asset + // represents. This field is immutable after create time. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_name = 1; + + // The type of the Google Cloud resource. Examples include: APPLICATION, + // PROJECT, and ORGANIZATION. This is a case insensitive field defined by + // Security Command Center and/or the producer of the resource and is + // immutable after create time. + string resource_type = 2; + + // The full resource name of the immediate parent of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_parent = 3; + + // The full resource name of the project the resource belongs to. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_project = 4; + + // Owners of the Google Cloud resource. + repeated string resource_owners = 5; + + // The user defined display name for this resource. + string resource_display_name = 6; + + // The user defined display name for the parent of this resource. + string resource_parent_display_name = 7; + + // The user defined display name for the project of this resource. + string resource_project_display_name = 8; + + // Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is the + // folder directly under the Organization. + repeated Folder folders = 10; + } + + // Cloud IAM Policy information associated with the Google Cloud resource + // described by the Security Command Center asset. This information is managed + // and defined by the Google Cloud resource and cannot be modified by the + // user. + message IamPolicy { + // The JSON representation of the Policy associated with the asset. + // See https://cloud.google.com/iam/reference/rest/v1/Policy for format + // details. + string policy_blob = 1; + } + + // The relative resource name of this asset. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/assets/{asset_id}". + string name = 1; + + // Security Command Center managed properties. These properties are managed by + // Security Command Center and cannot be modified by the user. + SecurityCenterProperties security_center_properties = 2; + + // Resource managed properties. These properties are managed and defined by + // the Google Cloud resource and cannot be modified by the user. + map resource_properties = 7; + + // User specified security marks. These marks are entirely managed by the user + // and come from the SecurityMarks resource that belongs to the asset. + SecurityMarks security_marks = 8; + + // The time at which the asset was created in Security Command Center. + google.protobuf.Timestamp create_time = 9; + + // The time at which the asset was last updated or added in Cloud SCC. + google.protobuf.Timestamp update_time = 10; + + // Cloud IAM Policy information associated with the Google Cloud resource + // described by the Security Command Center asset. This information is managed + // and defined by the Google Cloud resource and cannot be modified by the + // user. + IamPolicy iam_policy = 11; + + // The canonical name of the resource. It's either + // "organizations/{organization_id}/assets/{asset_id}", + // "folders/{folder_id}/assets/{asset_id}" or + // "projects/{project_number}/assets/{asset_id}", depending on the closest CRM + // ancestor of the resource. + string canonical_name = 13; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto new file mode 100644 index 00000000000..850c66e5d03 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/bigquery_export.proto @@ -0,0 +1,99 @@ +// 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.securitycenter.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "BigQueryExportProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Configures how to deliver Findings to BigQuery Instance. +message BigQueryExport { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/BigQueryExport" + pattern: "organizations/{organization}/bigQueryExports/{export}" + pattern: "folders/{folder}/bigQueryExports/{export}" + pattern: "projects/{project}/bigQueryExports/{export}" + }; + + // The relative resource name of this export. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name. + // Example format: + // "organizations/{organization_id}/bigQueryExports/{export_id}" Example + // format: "folders/{folder_id}/bigQueryExports/{export_id}" Example format: + // "projects/{project_id}/bigQueryExports/{export_id}" + // This field is provided in responses, and is ignored when provided in create + // requests. + string name = 1; + + // The description of the export (max of 1024 characters). + string description = 2; + + // Expression that defines the filter to apply across create/update events + // of findings. The expression is a list of zero or more restrictions combined + // via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + // has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a + // `-` character in front of them to indicate negation. The fields map to + // those defined in the corresponding resource. + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + string filter = 3; + + // The dataset to write findings' updates to. Its format is + // "projects/[project_id]/datasets/[bigquery_dataset_id]". + // BigQuery Dataset unique ID must contain only letters (a-z, A-Z), numbers + // (0-9), or underscores (_). + string dataset = 4; + + // Output only. The time at which the big query export was created. + // This field is set by the server and will be ignored if provided on export + // on creation. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time at which the big export was updated. + // This field is set by the server and will be ignored if provided on export + // creation or update. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the user who last edited the big query export. + // This field is set by the server and will be ignored if provided on export + // creation or update. + string most_recent_editor = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The service account that needs permission to create table, upload data to + // the big query dataset. + string principal = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto new file mode 100644 index 00000000000..ca1353b69d0 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto @@ -0,0 +1,39 @@ +// 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ComplianceProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Contains compliance information about a security standard indicating unmet +// recommendations. +message Compliance { + // Refers to industry wide standards or benchmarks e.g. "cis", "pci", "owasp", + // etc. + string standard = 1; + + // Version of the standard/benchmark e.g. 1.1 + string version = 2; + + // Policies within the standard/benchmark e.g. A.12.4.1 + repeated string ids = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto new file mode 100644 index 00000000000..29e95546c72 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/connection.proto @@ -0,0 +1,66 @@ +// 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ConnectionProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Contains information about the IP connection associated with the finding. +message Connection { + // IANA Internet Protocol Number such as TCP(6) and UDP(17). + enum Protocol { + // Unspecified protocol (not HOPOPT). + PROTOCOL_UNSPECIFIED = 0; + + // Internet Control Message Protocol. + ICMP = 1; + + // Transmission Control Protocol. + TCP = 6; + + // User Datagram Protocol. + UDP = 17; + + // Generic Routing Encapsulation. + GRE = 47; + + // Encap Security Payload. + ESP = 50; + } + + // Destination IP address. Not present for sockets that are listening and not + // connected. + string destination_ip = 1; + + // Destination port. Not present for sockets that are listening and not + // connected. + int32 destination_port = 2; + + // Source IP address. + string source_ip = 3; + + // Source port. + int32 source_port = 4; + + // IANA Internet Protocol Number such as TCP(6) and UDP(17). + Protocol protocol = 5; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto new file mode 100644 index 00000000000..c282d325b69 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto @@ -0,0 +1,37 @@ +// 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ContactDetailsProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// The details pertaining to specific contacts +message ContactDetails { + // A list of contacts + repeated Contact contacts = 1; +} + +// Representa a single contact's email address +message Contact { + // An email address e.g. "person123@company.com" + string email = 1; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto new file mode 100644 index 00000000000..65ca458cfc8 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto @@ -0,0 +1,45 @@ +// 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.securitycenter.v1; + +import "google/cloud/securitycenter/v1/label.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ContainerProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Container associated with the finding. +message Container { + // Container name. + string name = 1; + + // Container image URI provided when configuring a pod/container. + // May identify a container image version using mutable tags. + string uri = 2; + + // Optional container image id, when provided by the container runtime. + // Uniquely identifies the container image launched using a container image + // digest. + string image_id = 3; + + // Container labels, as provided by the container runtime. + repeated Label labels = 4; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto new file mode 100644 index 00000000000..276b31004ee --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto @@ -0,0 +1,52 @@ +// 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "DatabaseProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents database access information, such as queries. +// A database may be a sub-resource of an instance (as in the case of CloudSQL +// instances or Cloud Spanner instances), or the database instance itself. +// Some database resources may not have the full resource name populated +// because these resource types are not yet supported by Cloud Asset Inventory +// (e.g. CloudSQL databases). In these cases only the display name will be +// provided. +message Database { + // The full resource name of the database the user connected to, if it is + // supported by CAI. (https://google.aip.dev/122#full-resource-names) + string name = 1; + + // The human readable name of the database the user connected to. + string display_name = 2; + + // The username used to connect to the DB. This may not necessarily be an IAM + // principal, and has no required format. + string user_name = 3; + + // The SQL statement associated with the relevant access. + string query = 4; + + // The target usernames/roles/groups of a SQL privilege grant (not an IAM + // policy change). + repeated string grantees = 5; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto new file mode 100644 index 00000000000..14e644f6602 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto @@ -0,0 +1,52 @@ +// 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ExfiltrationProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Exfiltration represents a data exfiltration attempt of one or more +// sources to one or more targets. Sources represent the source +// of data that is exfiltrated, and Targets represents the destination the +// data was copied to. +message Exfiltration { + // If there are multiple sources, then the data is considered "joined" between + // them. For instance, BigQuery can join multiple tables, and each + // table would be considered a source. + repeated ExfilResource sources = 1; + + // If there are multiple targets, each target would get a complete copy of the + // "joined" source data. + repeated ExfilResource targets = 2; +} + +// Resource that has been exfiltrated or exfiltrated_to. +message ExfilResource { + // Resource's URI (https://google.aip.dev/122#full-resource-names) + string name = 1; + + // Subcomponents of the asset that is exfiltrated - these could be + // URIs used during exfiltration, table names, databases, filenames, etc. + // For example, multiple tables may be exfiltrated from the same CloudSQL + // instance, or multiple files from the same Cloud Storage bucket. + repeated string components = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto new file mode 100644 index 00000000000..8ba698138da --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/external_system.proto @@ -0,0 +1,59 @@ +// 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.securitycenter.v1; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ExternalSystemProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Representation of third party SIEM/SOAR fields within SCC. +message ExternalSystem { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/ExternalSystem" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}" + pattern: "folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}" + pattern: "projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}" + }; + + // External System Name e.g. jira, demisto, etc. + // e.g.: + // `organizations/1234/sources/5678/findings/123456/externalSystems/jira` + // `folders/1234/sources/5678/findings/123456/externalSystems/jira` + // `projects/1234/sources/5678/findings/123456/externalSystems/jira` + string name = 1; + + // References primary/secondary etc assignees in the external system. + repeated string assignees = 2; + + // Identifier that's used to track the given finding in the external system. + string external_uid = 3; + + // Most recent status of the corresponding finding's ticket/tracker in the + // external system. + string status = 4; + + // The most recent time when the corresponding finding's ticket/tracker was + // updated in the external system. + google.protobuf.Timestamp external_system_update_time = 5; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto new file mode 100644 index 00000000000..d802dda6ebf --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto @@ -0,0 +1,52 @@ +// 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "FileProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// File information about the related binary/library used by an executable, or +// the script used by a script interpreter +message File { + // Absolute path of the file as a JSON encoded string. + string path = 1; + + // Size of the file in bytes. + int64 size = 2; + + // SHA256 hash of the first hashed_size bytes of the file encoded as a + // hex string. If hashed_size == size, sha256 represents the SHA256 hash + // of the entire file. + string sha256 = 3; + + // The length in bytes of the file prefix that was hashed. If + // hashed_size == size, any hashes reported represent the entire + // file. + int64 hashed_size = 4; + + // True when the hash covers only a prefix of the file. + bool partially_hashed = 5; + + // Prefix of the file contents as a JSON encoded string. + // (Currently only populated for Malicious Script Executed findings.) + string contents = 6; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto new file mode 100644 index 00000000000..755b661772d --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -0,0 +1,339 @@ +// 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.securitycenter.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1/access.proto"; +import "google/cloud/securitycenter/v1/compliance.proto"; +import "google/cloud/securitycenter/v1/connection.proto"; +import "google/cloud/securitycenter/v1/contact_details.proto"; +import "google/cloud/securitycenter/v1/container.proto"; +import "google/cloud/securitycenter/v1/database.proto"; +import "google/cloud/securitycenter/v1/exfiltration.proto"; +import "google/cloud/securitycenter/v1/external_system.proto"; +import "google/cloud/securitycenter/v1/file.proto"; +import "google/cloud/securitycenter/v1/iam_binding.proto"; +import "google/cloud/securitycenter/v1/indicator.proto"; +import "google/cloud/securitycenter/v1/kubernetes.proto"; +import "google/cloud/securitycenter/v1/mitre_attack.proto"; +import "google/cloud/securitycenter/v1/process.proto"; +import "google/cloud/securitycenter/v1/security_marks.proto"; +import "google/cloud/securitycenter/v1/vulnerability.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Security Command Center finding. +// +// A finding is a record of assessment data like security, risk, health, or +// privacy, that is ingested into Security Command Center for presentation, +// notification, analysis, policy testing, and enforcement. For example, a +// cross-site scripting (XSS) vulnerability in an App Engine application is a +// finding. +message Finding { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Finding" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}" + pattern: "folders/{folder}/sources/{source}/findings/{finding}" + pattern: "projects/{project}/sources/{source}/findings/{finding}" + }; + + // The state of the finding. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // The finding requires attention and has not been addressed yet. + ACTIVE = 1; + + // The finding has been fixed, triaged as a non-issue or otherwise addressed + // and is no longer active. + INACTIVE = 2; + } + + // The severity of the finding. + enum Severity { + // This value is used for findings when a source doesn't write a severity + // value. + SEVERITY_UNSPECIFIED = 0; + + // Vulnerability: + // A critical vulnerability is easily discoverable by an external actor, + // exploitable, and results in the direct ability to execute arbitrary code, + // exfiltrate data, and otherwise gain additional access and privileges to + // cloud resources and workloads. Examples include publicly accessible + // unprotected user data, public SSH access with weak or no passwords, etc. + // + // Threat: + // Indicates a threat that is able to access, modify, or delete data or + // execute unauthorized code within existing resources. + CRITICAL = 1; + + // Vulnerability: + // A high risk vulnerability can be easily discovered and exploited in + // combination with other vulnerabilities in order to gain direct access and + // the ability to execute arbitrary code, exfiltrate data, and otherwise + // gain additional access and privileges to cloud resources and workloads. + // An example is a database with weak or no passwords that is only + // accessible internally. This database could easily be compromised by an + // actor that had access to the internal network. + // + // Threat: + // Indicates a threat that is able to create new computational resources in + // an environment but not able to access data or execute code in existing + // resources. + HIGH = 2; + + // Vulnerability: + // A medium risk vulnerability could be used by an actor to gain access to + // resources or privileges that enable them to eventually (through multiple + // steps or a complex exploit) gain access and the ability to execute + // arbitrary code or exfiltrate data. An example is a service account with + // access to more projects than it should have. If an actor gains access to + // the service account, they could potentially use that access to manipulate + // a project the service account was not intended to. + // + // Threat: + // Indicates a threat that is able to cause operational impact but may not + // access data or execute unauthorized code. + MEDIUM = 3; + + // Vulnerability: + // A low risk vulnerability hampers a security organization's ability to + // detect vulnerabilities or active threats in their deployment, or prevents + // the root cause investigation of security issues. An example is monitoring + // and logs being disabled for resource configurations and access. + // + // Threat: + // Indicates a threat that has obtained minimal access to an environment but + // is not able to access data, execute code, or create resources. + LOW = 4; + } + + // Mute state a finding can be in. + enum Mute { + // Unspecified. + MUTE_UNSPECIFIED = 0; + + // Finding has been muted. + MUTED = 1; + + // Finding has been unmuted. + UNMUTED = 2; + + // Finding has never been muted/unmuted. + UNDEFINED = 4; + } + + // Represents what kind of Finding it is. + enum FindingClass { + // Unspecified finding class. + FINDING_CLASS_UNSPECIFIED = 0; + + // Describes unwanted or malicious activity. + THREAT = 1; + + // Describes a potential weakness in software that increases risk to + // Confidentiality & Integrity & Availability. + VULNERABILITY = 2; + + // Describes a potential weakness in cloud resource/asset configuration that + // increases risk. + MISCONFIGURATION = 3; + + // Describes a security observation that is for informational purposes. + OBSERVATION = 4; + + // Describes an error that prevents some SCC functionality. + SCC_ERROR = 5; + } + + // The relative resource name of this finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" + string name = 1; + + // The relative resource name of the source the finding belongs to. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // This field is immutable after creation time. + // For example: + // "organizations/{organization_id}/sources/{source_id}" + string parent = 2; + + // For findings on Google Cloud resources, the full resource + // name of the Google Cloud resource this finding is for. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + // When the finding is for a non-Google Cloud resource, the resourceName can + // be a customer or partner defined string. This field is immutable after + // creation time. + string resource_name = 3; + + // The state of the finding. + State state = 4; + + // The additional taxonomy group within findings from a given source. + // This field is immutable after creation time. + // Example: "XSS_FLASH_INJECTION" + string category = 5; + + // The URI that, if available, points to a web page outside of Security + // Command Center where additional information about the finding can be found. + // This field is guaranteed to be either empty or a well formed URL. + string external_uri = 6; + + // Source specific properties. These properties are managed by the source + // that writes the finding. The key names in the source_properties map must be + // between 1 and 255 characters, and must start with a letter and contain + // alphanumeric characters or underscores only. + map source_properties = 7; + + // Output only. User specified security marks. These marks are entirely + // managed by the user and come from the SecurityMarks resource that belongs + // to the finding. + SecurityMarks security_marks = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The time the finding was first detected. If an existing finding is updated, + // then this is the time the update occurred. + // For example, if the finding represents an open firewall, this property + // captures the time the detector believes the firewall became open. The + // accuracy is determined by the detector. If the finding is later resolved, + // then this time reflects when the finding was resolved. This must not + // be set to a value greater than the current timestamp. + google.protobuf.Timestamp event_time = 9; + + // The time at which the finding was created in Security Command Center. + google.protobuf.Timestamp create_time = 10; + + // The severity of the finding. This field is managed by the source that + // writes the finding. + Severity severity = 12; + + // The canonical name of the finding. It's either + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + // "folders/{folder_id}/sources/{source_id}/findings/{finding_id}" or + // "projects/{project_number}/sources/{source_id}/findings/{finding_id}", + // depending on the closest CRM ancestor of the resource associated with the + // finding. + string canonical_name = 14; + + // Indicates the mute state of a finding (either muted, unmuted + // or undefined). Unlike other attributes of a finding, a finding provider + // shouldn't set the value of mute. + Mute mute = 15; + + // The class of the finding. + FindingClass finding_class = 17; + + // Represents what's commonly known as an Indicator of compromise (IoC) in + // computer forensics. This is an artifact observed on a network or in an + // operating system that, with high confidence, indicates a computer + // intrusion. + // Reference: https://en.wikipedia.org/wiki/Indicator_of_compromise + Indicator indicator = 18; + + // Represents vulnerability specific fields like cve, cvss scores etc. + // CVE stands for Common Vulnerabilities and Exposures + // (https://cve.mitre.org/about/) + Vulnerability vulnerability = 20; + + // Output only. The most recent time this finding was muted or unmuted. + google.protobuf.Timestamp mute_update_time = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Third party SIEM/SOAR fields within SCC, contains external system + // information and external system finding fields. + map external_systems = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // MITRE ATT&CK tactics and techniques related to this finding. + // See: https://attack.mitre.org + MitreAttack mitre_attack = 25; + + // Access details associated to the Finding, such as more information on the + // caller, which method was accessed, from where, etc. + Access access = 26; + + // Contains information about the IP connection associated with the finding. + repeated Connection connections = 31; + + // First known as mute_annotation. Records additional information about the + // mute operation e.g. mute config that muted the finding, user who muted the + // finding, etc. Unlike other attributes of a finding, a finding provider + // shouldn't set the value of mute. + string mute_initiator = 28; + + // Represents operating system processes associated with the Finding. + repeated Process processes = 30; + + // Output only. Map containing the points of contact for the given finding. The key + // represents the type of contact, while the value contains a list of all the + // contacts that pertain. Please refer to: + // https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories + // + // { + // "security": { + // "contacts": [ + // { + // "email": "person1@company.com" + // }, + // { + // "email": "person2@company.com" + // } + // ] + // } + // } + map contacts = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Contains compliance information for security standards associated to the + // finding. + repeated Compliance compliances = 34; + + // Output only. The human readable display name of the finding source such as + // "Event Threat Detection" or "Security Health Analytics". + string parent_display_name = 36 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Contains more detail about the finding. + string description = 37; + + // Represents exfiltration associated with the Finding. + Exfiltration exfiltration = 38; + + // Represents IAM bindings associated with the Finding. + repeated IamBinding iam_bindings = 39; + + // Next steps associate to the finding. + string next_steps = 40; + + // Containers associated with the finding. containers provides information + // for both Kubernetes and non-Kubernetes containers. + repeated Container containers = 42; + + // Kubernetes resources associated with the finding. + Kubernetes kubernetes = 43; + + // Database associated with the finding. + Database database = 44; + + // File associated with the finding. + repeated File files = 46; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto new file mode 100644 index 00000000000..4078a527b33 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/folder.proto @@ -0,0 +1,36 @@ +// 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "FolderProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Message that contains the resource name and display name of a folder +// resource. +message Folder { + // Full resource name of this folder. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_folder = 1; + + // The user defined display name for this folder. + string resource_folder_display_name = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto new file mode 100644 index 00000000000..c1e57a37382 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto @@ -0,0 +1,52 @@ +// 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "IamBindingProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents a particular IAM binding, which captures a member's role addition, +// removal, or state. +message IamBinding { + // The type of action performed on a Binding in a policy. + enum Action { + // Unspecified. + ACTION_UNSPECIFIED = 0; + + // Addition of a Binding. + ADD = 1; + + // Removal of a Binding. + REMOVE = 2; + } + + // The action that was performed on a Binding. + Action action = 1; + + // Role that is assigned to "members". + // For example, "roles/viewer", "roles/editor", or "roles/owner". + string role = 2; + + // A single identity requesting access for a Cloud Platform resource, + // e.g. "foo@google.com". + string member = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto new file mode 100644 index 00000000000..1cbfdfa2c9a --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/indicator.proto @@ -0,0 +1,82 @@ +// 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "IndicatorProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents what's commonly known as an Indicator of compromise (IoC) in +// computer forensics. This is an artifact observed on a network or in an +// operating system that, with high confidence, indicates a computer intrusion. +// Reference: https://en.wikipedia.org/wiki/Indicator_of_compromise +message Indicator { + // Indicates what signature matched this process. + message ProcessSignature { + // A signature corresponding to memory page hashes. + message MemoryHashSignature { + // Memory hash detection contributing to the binary family match. + message Detection { + // The name of the binary associated with the memory hash + // signature detection. + string binary = 2; + + // The percentage of memory page hashes in the signature + // that were matched. + double percent_pages_matched = 3; + } + + // The binary family. + string binary_family = 1; + + // The list of memory hash detections contributing to the binary family + // match. + repeated Detection detections = 4; + } + + // A signature corresponding to a YARA rule. + message YaraRuleSignature { + // The name of the YARA rule. + string yara_rule = 5; + } + + oneof signature { + // Signature indicating that a binary family was matched. + MemoryHashSignature memory_hash_signature = 6; + + // Signature indicating that a YARA rule was matched. + YaraRuleSignature yara_rule_signature = 7; + } + } + + // List of ip addresses associated to the Finding. + repeated string ip_addresses = 1; + + // List of domains associated to the Finding. + repeated string domains = 2; + + // The list of matched signatures indicating that the given + // process is present in the environment. + repeated ProcessSignature signatures = 3; + + // The list of URIs associated to the Findings. + repeated string uris = 4; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto new file mode 100644 index 00000000000..bf3bc3608c5 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto @@ -0,0 +1,181 @@ +// 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.securitycenter.v1; + +import "google/cloud/securitycenter/v1/container.proto"; +import "google/cloud/securitycenter/v1/label.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "KubernetesProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Kubernetes related attributes. +message Kubernetes { + // Kubernetes Pod. + message Pod { + // Kubernetes Pod namespace. + string ns = 1; + + // Kubernetes Pod name. + string name = 2; + + // Pod labels. For Kubernetes containers, these are applied to the + // container. + repeated Label labels = 3; + + // Pod containers associated with this finding, if any. + repeated Container containers = 4; + } + + // Kubernetes Nodes associated with the finding. + message Node { + // Full Resource name of the Compute Engine VM running the + // cluster node. + string name = 1; + } + + // Provides GKE Node Pool information. + message NodePool { + // Kubernetes Node pool name. + string name = 1; + + // Nodes associated with the finding. + repeated Node nodes = 2; + } + + // Kubernetes Role or ClusterRole. + message Role { + // Types of Kubernetes roles. + enum Kind { + // Role type is not specified. + KIND_UNSPECIFIED = 0; + + // Kubernetes Role. + ROLE = 1; + + // Kubernetes ClusterRole. + CLUSTER_ROLE = 2; + } + + // Role type. + Kind kind = 1; + + // Role namespace. + string ns = 2; + + // Role name. + string name = 3; + } + + // Represents a Kubernetes RoleBinding or ClusterRoleBinding. + message Binding { + // Namespace for binding. + string ns = 1; + + // Name for binding. + string name = 2; + + // The Role or ClusterRole referenced by the binding. + Role role = 3; + + // Represents the subjects(s) bound to the role. Not always available + // for PATCH requests. + repeated Subject subjects = 4; + } + + // Represents a Kubernetes Subject. + message Subject { + // Auth types that can be used for Subject's kind field. + enum AuthType { + // Authentication is not specified. + AUTH_TYPE_UNSPECIFIED = 0; + + // User with valid certificate. + USER = 1; + + // Users managed by Kubernetes API with credentials stored as Secrets. + SERVICEACCOUNT = 2; + + // Collection of users. + GROUP = 3; + } + + // Authentication type for subject. + AuthType kind = 1; + + // Namespace for subject. + string ns = 2; + + // Name for subject. + string name = 3; + } + + // Conveys information about a Kubernetes access review (e.g. kubectl auth + // can-i ...) that was involved in a finding. + message AccessReview { + // Group is the API Group of the Resource. "*" means all. + string group = 1; + + // Namespace of the action being requested. Currently, there is no + // distinction between no namespace and all namespaces. Both + // are represented by "" (empty). + string ns = 2; + + // Name is the name of the resource being requested. Empty means all. + string name = 3; + + // Resource is the optional resource type requested. "*" means all. + string resource = 4; + + // Subresource is the optional subresource type. + string subresource = 5; + + // Verb is a Kubernetes resource API verb, like: get, list, watch, create, + // update, delete, proxy. "*" means all. + string verb = 6; + + // Version is the API Version of the Resource. "*" means all. + string version = 7; + } + + // Kubernetes Pods associated with the finding. This field will contain Pod + // records for each container that is owned by a Pod. + repeated Pod pods = 1; + + // Provides Kubernetes Node information. + repeated Node nodes = 2; + + // GKE Node Pools associated with the finding. This field will + // contain NodePool information for each Node, when it is available. + repeated NodePool node_pools = 3; + + // Provides Kubernetes role information for findings that involve + // Roles or ClusterRoles. + repeated Role roles = 4; + + // Provides Kubernetes role binding information for findings that involve + // RoleBindings or ClusterRoleBindings. + repeated Binding bindings = 5; + + // Provides information on any Kubernetes access reviews (i.e. privilege + // checks) relevant to the finding. + repeated AccessReview access_reviews = 6; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto new file mode 100644 index 00000000000..30321d90718 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "LabelProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Label represents a generic name=value label. Label has separate name and +// value fields to support filtering with contains(). +message Label { + // Label name. + string name = 1; + + // Label value. + string value = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto new file mode 100644 index 00000000000..ab8262ccfbb --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mitre_attack.proto @@ -0,0 +1,211 @@ +// 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "MitreAttackProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// MITRE ATT&CK tactics and techniques related to this finding. +// See: https://attack.mitre.org +message MitreAttack { + // MITRE ATT&CK tactics that can be referenced by SCC findings. + // See: https://attack.mitre.org/tactics/enterprise/ + enum Tactic { + // Unspecified value. + TACTIC_UNSPECIFIED = 0; + + // TA0043 + RECONNAISSANCE = 1; + + // TA0042 + RESOURCE_DEVELOPMENT = 2; + + // TA0001 + INITIAL_ACCESS = 5; + + // TA0002 + EXECUTION = 3; + + // TA0003 + PERSISTENCE = 6; + + // TA0004 + PRIVILEGE_ESCALATION = 8; + + // TA0005 + DEFENSE_EVASION = 7; + + // TA0006 + CREDENTIAL_ACCESS = 9; + + // TA0007 + DISCOVERY = 10; + + // TA0008 + LATERAL_MOVEMENT = 11; + + // TA0009 + COLLECTION = 12; + + // TA0011 + COMMAND_AND_CONTROL = 4; + + // TA0010 + EXFILTRATION = 13; + + // TA0040 + IMPACT = 14; + } + + // MITRE ATT&CK techniques that can be referenced by SCC findings. + // See: https://attack.mitre.org/techniques/enterprise/ + enum Technique { + // Unspecified value. + TECHNIQUE_UNSPECIFIED = 0; + + // T1595 + ACTIVE_SCANNING = 1; + + // T1595.001 + SCANNING_IP_BLOCKS = 2; + + // T1105 + INGRESS_TOOL_TRANSFER = 3; + + // T1106 + NATIVE_API = 4; + + // T1129 + SHARED_MODULES = 5; + + // T1059 + COMMAND_AND_SCRIPTING_INTERPRETER = 6; + + // T1059.004 + UNIX_SHELL = 7; + + // T1496 + RESOURCE_HIJACKING = 8; + + // T1090 + PROXY = 9; + + // T1090.002 + EXTERNAL_PROXY = 10; + + // T1090.003 + MULTI_HOP_PROXY = 11; + + // T1568 + DYNAMIC_RESOLUTION = 12; + + // T1552 + UNSECURED_CREDENTIALS = 13; + + // T1078 + VALID_ACCOUNTS = 14; + + // T1078.003 + LOCAL_ACCOUNTS = 15; + + // T1078.004 + CLOUD_ACCOUNTS = 16; + + // T1498 + NETWORK_DENIAL_OF_SERVICE = 17; + + // T1069 + PERMISSION_GROUPS_DISCOVERY = 18; + + // T1069.003 + CLOUD_GROUPS = 19; + + // T1567 + EXFILTRATION_OVER_WEB_SERVICE = 20; + + // T1567.002 + EXFILTRATION_TO_CLOUD_STORAGE = 21; + + // T1098 + ACCOUNT_MANIPULATION = 22; + + // T1098.004 + SSH_AUTHORIZED_KEYS = 23; + + // T1543 + CREATE_OR_MODIFY_SYSTEM_PROCESS = 24; + + // T1539 + STEAL_WEB_SESSION_COOKIE = 25; + + // T1578 + MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26; + + // T1190 + EXPLOIT_PUBLIC_FACING_APPLICATION = 27; + + // T1556 + MODIFY_AUTHENTICATION_PROCESS = 28; + + // T1485 + DATA_DESTRUCTION = 29; + + // T1484 + DOMAIN_POLICY_MODIFICATION = 30; + + // T1562 + IMPAIR_DEFENSES = 31; + + // T1046 + NETWORK_SERVICE_DISCOVERY = 32; + + // T1134 + ACCESS_TOKEN_MANIPULATION = 33; + + // T1548 + ABUSE_ELEVATION_CONTROL_MECHANISM = 34; + + // T1078.001 + DEFAULT_ACCOUNTS = 35; + } + + // The MITRE ATT&CK tactic most closely represented by this finding, if any. + Tactic primary_tactic = 1; + + // The MITRE ATT&CK technique most closely represented by this finding, if + // any. primary_techniques is a repeated field because there are multiple + // levels of MITRE ATT&CK techniques. If the technique most closely + // represented by this finding is a sub-technique (e.g. `SCANNING_IP_BLOCKS`), + // both the sub-technique and its parent technique(s) will be listed (e.g. + // `SCANNING_IP_BLOCKS`, `ACTIVE_SCANNING`). + repeated Technique primary_techniques = 2; + + // Additional MITRE ATT&CK tactics related to this finding, if any. + repeated Tactic additional_tactics = 3; + + // Additional MITRE ATT&CK techniques related to this finding, if any, along + // with any of their respective parent techniques. + repeated Technique additional_techniques = 4; + + // The MITRE ATT&CK version referenced by the above fields. E.g. "8". + string version = 5; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto new file mode 100644 index 00000000000..74426957b7c --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/mute_config.proto @@ -0,0 +1,89 @@ +// 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.securitycenter.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "MuteConfigProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// A mute config is a Cloud SCC resource that contains the configuration +// to mute create/update events of findings. +message MuteConfig { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/MuteConfig" + pattern: "organizations/{organization}/muteConfigs/{mute_config}" + pattern: "folders/{folder}/muteConfigs/{mute_config}" + pattern: "projects/{project}/muteConfigs/{mute_config}" + }; + + // This field will be ignored if provided on config creation. Format + // "organizations/{organization}/muteConfigs/{mute_config}" + // "folders/{folder}/muteConfigs/{mute_config}" + // "projects/{project}/muteConfigs/{mute_config}" + string name = 1; + + // The human readable name to be displayed for the mute config. + string display_name = 2 [deprecated = true]; + + // A description of the mute config. + string description = 3; + + // Required. An expression that defines the filter to apply across create/update events + // of findings. While creating a filter string, be mindful of the + // scope in which the mute configuration is being created. E.g., If a filter + // contains project = X but is created under the project = Y scope, it might + // not match any findings. + // + // The following field and operator combinations are supported: + // + // * severity: `=`, `:` + // * category: `=`, `:` + // * resource.name: `=`, `:` + // * resource.project_name: `=`, `:` + // * resource.project_display_name: `=`, `:` + // * resource.folders.resource_folder: `=`, `:` + // * resource.parent_name: `=`, `:` + // * resource.parent_display_name: `=`, `:` + // * resource.type: `=`, `:` + // * finding_class: `=`, `:` + // * indicator.ip_addresses: `=`, `:` + // * indicator.domains: `=`, `:` + string filter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The time at which the mute config was created. + // This field is set by the server and will be ignored if provided on config + // creation. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time at which the mute config was updated. + // This field is set by the server and will be ignored if provided on config + // creation or update. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the user who last edited the mute config. + // This field is set by the server and will be ignored if provided on config + // creation or update. + string most_recent_editor = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto new file mode 100644 index 00000000000..ee1e9546078 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto @@ -0,0 +1,97 @@ +// 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.securitycenter.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "NotificationConfigProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Cloud Security Command Center (Cloud SCC) notification configs. +// +// A notification config is a Cloud SCC resource that contains the configuration +// to send notifications for create/update events of findings, assets and etc. +message NotificationConfig { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/NotificationConfig" + pattern: "organizations/{organization}/notificationConfigs/{notification_config}" + pattern: "folders/{folder}/notificationConfigs/{notification_config}" + pattern: "projects/{project}/notificationConfigs/{notification_config}" + }; + + // The config for streaming-based notifications, which send each event as soon + // as it is detected. + message StreamingConfig { + // Expression that defines the filter to apply across create/update events + // of assets or findings as specified by the event type. The expression is a + // list of zero or more restrictions combined via logical operators `AND` + // and `OR`. Parentheses are supported, and `OR` has higher precedence than + // `AND`. + // + // Restrictions have the form ` ` and may have a + // `-` character in front of them to indicate negation. The fields map to + // those defined in the corresponding resource. + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + string filter = 1; + } + + // The relative resource name of this notification config. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/notificationConfigs/notify_public_bucket". + string name = 1; + + // The description of the notification config (max of 1024 characters). + string description = 2; + + // The Pub/Sub topic to send notifications to. Its format is + // "projects/[project_id]/topics/[topic]". + string pubsub_topic = 3 [(google.api.resource_reference) = { + type: "pubsub.googleapis.com/Topic" + }]; + + // Output only. The service account that needs "pubsub.topics.publish" + // permission to publish to the Pub/Sub topic. + string service_account = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The config for triggering notifications. + oneof notify_config { + // The config for triggering streaming-based notifications. + StreamingConfig streaming_config = 5; + } +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto new file mode 100644 index 00000000000..3605dfbefae --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto @@ -0,0 +1,44 @@ +// 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.securitycenter.v1; + +import "google/cloud/securitycenter/v1/finding.proto"; +import "google/cloud/securitycenter/v1/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "NotificationMessageProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Cloud SCC's Notification +message NotificationMessage { + // Name of the notification config that generated current notification. + string notification_config_name = 1; + + // Notification Event. + oneof event { + // If it's a Finding based notification config, this field will be + // populated. + Finding finding = 2; + } + + // The Cloud resource tied to this notification's Finding. + Resource resource = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto new file mode 100644 index 00000000000..e8bc9687d02 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// User specified settings that are attached to the Security Command +// Center organization. +message OrganizationSettings { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + pattern: "organizations/{organization}/organizationSettings" + }; + + // The configuration used for Asset Discovery runs. + message AssetDiscoveryConfig { + // The mode of inclusion when running Asset Discovery. + // Asset discovery can be limited by explicitly identifying projects to be + // included or excluded. If INCLUDE_ONLY is set, then only those projects + // within the organization and their children are discovered during asset + // discovery. If EXCLUDE is set, then projects that don't match those + // projects are discovered during asset discovery. If neither are set, then + // all projects within the organization are discovered during asset + // discovery. + enum InclusionMode { + // Unspecified. Setting the mode with this value will disable + // inclusion/exclusion filtering for Asset Discovery. + INCLUSION_MODE_UNSPECIFIED = 0; + + // Asset Discovery will capture only the resources within the projects + // specified. All other resources will be ignored. + INCLUDE_ONLY = 1; + + // Asset Discovery will ignore all resources under the projects specified. + // All other resources will be retrieved. + EXCLUDE = 2; + } + + // The project ids to use for filtering asset discovery. + repeated string project_ids = 1; + + // The mode to use for filtering asset discovery. + InclusionMode inclusion_mode = 2; + + // The folder ids to use for filtering asset discovery. + // It consists of only digits, e.g., 756619654966. + repeated string folder_ids = 3; + } + + // The relative resource name of the settings. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/organizationSettings". + string name = 1; + + // A flag that indicates if Asset Discovery should be enabled. If the flag is + // set to `true`, then discovery of assets will occur. If it is set to `false, + // all historical assets will remain, but discovery of future assets will not + // occur. + bool enable_asset_discovery = 2; + + // The configuration used for Asset Discovery runs. + AssetDiscoveryConfig asset_discovery_config = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto new file mode 100644 index 00000000000..480714be47d --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto @@ -0,0 +1,74 @@ +// 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.securitycenter.v1; + +import "google/cloud/securitycenter/v1/file.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ProcessProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Represents an operating system process. +message Process { + // The process name visible in utilities like `top` and `ps`; it can + // be accessed via `/proc/[pid]/comm` and changed with `prctl(PR_SET_NAME)`. + string name = 12; + + // File information for the process executable. + File binary = 3; + + // File information for libraries loaded by the process. + repeated File libraries = 4; + + // When the process represents the invocation of a script, + // `binary` provides information about the interpreter while `script` + // provides information about the script file provided to the + // interpreter. + File script = 5; + + // Process arguments as JSON encoded strings. + repeated string args = 6; + + // True if `args` is incomplete. + bool arguments_truncated = 7; + + // Process environment variables. + repeated EnvironmentVariable env_variables = 8; + + // True if `env_variables` is incomplete. + bool env_variables_truncated = 9; + + // The process id. + int64 pid = 10; + + // The parent process id. + int64 parent_pid = 11; +} + +// EnvironmentVariable is a name-value pair to store environment variables for +// Process. +message EnvironmentVariable { + // Environment variable name as a JSON encoded string. + string name = 1; + + // Environment variable value as a JSON encoded string. + string val = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto new file mode 100644 index 00000000000..ab241d8bf3f --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto @@ -0,0 +1,58 @@ +// 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.securitycenter.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/securitycenter/v1/folder.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ResourceProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Information related to the Google Cloud resource. +message Resource { + // The full resource name of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string name = 1; + + // The human readable name of the resource. + string display_name = 8; + + // The full resource type of the resource. + string type = 6; + + // The full resource name of project that the resource belongs to. + string project = 2; + + // The project ID that the resource belongs to. + string project_display_name = 3; + + // The full resource name of resource's parent. + string parent = 4; + + // The human readable name of resource's parent. + string parent_display_name = 5; + + // Output only. Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is the + // folder directly under the Organization. + repeated Folder folders = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto new file mode 100644 index 00000000000..70088c06a64 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto @@ -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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Response of asset discovery run +message RunAssetDiscoveryResponse { + // The state of an asset discovery run. + enum State { + // Asset discovery run state was unspecified. + STATE_UNSPECIFIED = 0; + + // Asset discovery run completed successfully. + COMPLETED = 1; + + // Asset discovery run was cancelled with tasks still pending, as another + // run for the same organization was started with a higher priority. + SUPERSEDED = 2; + + // Asset discovery run was killed and terminated. + TERMINATED = 3; + } + + // The state of an asset discovery run. + State state = 1; + + // The duration between asset discovery run start and end + google.protobuf.Duration duration = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto new file mode 100644 index 00000000000..15c9769f226 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto @@ -0,0 +1,69 @@ +// 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.securitycenter.v1; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// User specified security marks that are attached to the parent Security +// Command Center resource. Security marks are scoped within a Security Command +// Center organization -- they can be modified and viewed by all users who have +// proper permissions on the organization. +message SecurityMarks { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/SecurityMarks" + pattern: "organizations/{organization}/assets/{asset}/securityMarks" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + pattern: "folders/{folder}/assets/{asset}/securityMarks" + pattern: "projects/{project}/assets/{asset}/securityMarks" + pattern: "folders/{folder}/sources/{source}/findings/{finding}/securityMarks" + pattern: "projects/{project}/sources/{source}/findings/{finding}/securityMarks" + }; + + // The relative resource name of the SecurityMarks. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Examples: + // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". + string name = 1; + + // Mutable user specified security marks belonging to the parent resource. + // Constraints are as follows: + // + // * Keys and values are treated as case insensitive + // * Keys must be between 1 - 256 characters (inclusive) + // * Keys must be letters, numbers, underscores, or dashes + // * Values have leading and trailing whitespace trimmed, remaining + // characters must be between 1 - 4096 characters (inclusive) + map marks = 2; + + // The canonical name of the marks. + // Examples: + // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + // "folders/{folder_id}/assets/{asset_id}/securityMarks" + // "projects/{project_number}/assets/{asset_id}/securityMarks" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks" + // "folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks" + // "projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks" + string canonical_name = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto new file mode 100644 index 00000000000..24e5e27e610 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -0,0 +1,1880 @@ +// 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.securitycenter.v1; + +import public "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1/asset.proto"; +import "google/cloud/securitycenter/v1/bigquery_export.proto"; +import "google/cloud/securitycenter/v1/external_system.proto"; +import "google/cloud/securitycenter/v1/finding.proto"; +import "google/cloud/securitycenter/v1/folder.proto"; +import "google/cloud/securitycenter/v1/mute_config.proto"; +import "google/cloud/securitycenter/v1/notification_config.proto"; +import "google/cloud/securitycenter/v1/organization_settings.proto"; +import "google/cloud/securitycenter/v1/security_marks.proto"; +import "google/cloud/securitycenter/v1/source.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// V1 APIs for Security Center service. +service SecurityCenter { + option (google.api.default_host) = "securitycenter.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Kicks off an LRO to bulk mute findings for a parent based on a filter. The + // parent can be either an organization, folder or project. The findings + // matched by the filter will be muted after the LRO is done. + rpc BulkMuteFindings(BulkMuteFindingsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/findings:bulkMute" + body: "*" + additional_bindings { + post: "/v1/{parent=folders/*}/findings:bulkMute" + body: "*" + } + additional_bindings { + post: "/v1/{parent=projects/*}/findings:bulkMute" + body: "*" + } + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.securitycenter.v1.BulkMuteFindingsResponse" + metadata_type: "google.protobuf.Empty" + }; + } + + // Creates a source. + rpc CreateSource(CreateSourceRequest) returns (Source) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/sources" + body: "source" + }; + option (google.api.method_signature) = "parent,source"; + } + + // Creates a finding. The corresponding source must exist for finding creation + // to succeed. + rpc CreateFinding(CreateFindingRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/sources/*}/findings" + body: "finding" + }; + option (google.api.method_signature) = "parent,finding_id,finding"; + } + + // Creates a mute config. + rpc CreateMuteConfig(CreateMuteConfigRequest) returns (MuteConfig) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/muteConfigs" + body: "mute_config" + additional_bindings { + post: "/v1/{parent=folders/*}/muteConfigs" + body: "mute_config" + } + additional_bindings { + post: "/v1/{parent=projects/*}/muteConfigs" + body: "mute_config" + } + }; + option (google.api.method_signature) = "parent,mute_config"; + option (google.api.method_signature) = "parent,mute_config,mute_config_id"; + } + + // Creates a notification config. + rpc CreateNotificationConfig(CreateNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/notificationConfigs" + body: "notification_config" + additional_bindings { + post: "/v1/{parent=folders/*}/notificationConfigs" + body: "notification_config" + } + additional_bindings { + post: "/v1/{parent=projects/*}/notificationConfigs" + body: "notification_config" + } + }; + option (google.api.method_signature) = + "parent,config_id,notification_config"; + option (google.api.method_signature) = "parent,notification_config"; + } + + // Deletes an existing mute config. + rpc DeleteMuteConfig(DeleteMuteConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/muteConfigs/*}" + additional_bindings { delete: "/v1/{name=folders/*/muteConfigs/*}" } + additional_bindings { delete: "/v1/{name=projects/*/muteConfigs/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a notification config. + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/notificationConfigs/*}" + additional_bindings { + delete: "/v1/{name=folders/*/notificationConfigs/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/notificationConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets a big query export. + rpc GetBigQueryExport(GetBigQueryExportRequest) returns (BigQueryExport) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/bigQueryExports/*}" + additional_bindings { get: "/v1/{name=folders/*/bigQueryExports/*}" } + additional_bindings { get: "/v1/{name=projects/*/bigQueryExports/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Gets the access control policy on the specified Source. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Gets a mute config. + rpc GetMuteConfig(GetMuteConfigRequest) returns (MuteConfig) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/muteConfigs/*}" + additional_bindings { get: "/v1/{name=folders/*/muteConfigs/*}" } + additional_bindings { get: "/v1/{name=projects/*/muteConfigs/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Gets a notification config. + rpc GetNotificationConfig(GetNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/notificationConfigs/*}" + additional_bindings { get: "/v1/{name=folders/*/notificationConfigs/*}" } + additional_bindings { get: "/v1/{name=projects/*/notificationConfigs/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Gets the settings for an organization. + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) + returns (OrganizationSettings) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/organizationSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a source. + rpc GetSource(GetSourceRequest) returns (Source) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/sources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Filters an organization's assets and groups them by their specified + // properties. + rpc GroupAssets(GroupAssetsRequest) returns (GroupAssetsResponse) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/assets:group" + body: "*" + additional_bindings { + post: "/v1/{parent=folders/*}/assets:group" + body: "*" + } + additional_bindings { + post: "/v1/{parent=projects/*}/assets:group" + body: "*" + } + }; + } + + // Filters an organization or source's findings and groups them by their + // specified properties. + // + // To group across all sources provide a `-` as the source id. + // Example: /v1/organizations/{organization_id}/sources/-/findings, + // /v1/folders/{folder_id}/sources/-/findings, + // /v1/projects/{project_id}/sources/-/findings + rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/sources/*}/findings:group" + body: "*" + additional_bindings { + post: "/v1/{parent=folders/*/sources/*}/findings:group" + body: "*" + } + additional_bindings { + post: "/v1/{parent=projects/*/sources/*}/findings:group" + body: "*" + } + }; + option (google.api.method_signature) = "parent,group_by"; + } + + // Lists an organization's assets. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/assets" + additional_bindings { get: "/v1/{parent=folders/*}/assets" } + additional_bindings { get: "/v1/{parent=projects/*}/assets" } + }; + } + + // Lists an organization or source's findings. + // + // To list across all sources provide a `-` as the source id. + // Example: /v1/organizations/{organization_id}/sources/-/findings + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/sources/*}/findings" + additional_bindings { get: "/v1/{parent=folders/*/sources/*}/findings" } + additional_bindings { get: "/v1/{parent=projects/*/sources/*}/findings" } + }; + } + + // Lists mute configs. + rpc ListMuteConfigs(ListMuteConfigsRequest) + returns (ListMuteConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/muteConfigs" + additional_bindings { get: "/v1/{parent=folders/*}/muteConfigs" } + additional_bindings { get: "/v1/{parent=projects/*}/muteConfigs" } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists notification configs. + rpc ListNotificationConfigs(ListNotificationConfigsRequest) + returns (ListNotificationConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/notificationConfigs" + additional_bindings { get: "/v1/{parent=folders/*}/notificationConfigs" } + additional_bindings { get: "/v1/{parent=projects/*}/notificationConfigs" } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all sources belonging to an organization. + rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/sources" + additional_bindings { get: "/v1/{parent=folders/*}/sources" } + additional_bindings { get: "/v1/{parent=projects/*}/sources" } + }; + option (google.api.method_signature) = "parent"; + } + + // Runs asset discovery. The discovery is tracked with a long-running + // operation. + // + // This API can only be called with limited frequency for an organization. If + // it is called too frequently the caller will receive a TOO_MANY_REQUESTS + // error. + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/assets:runDiscovery" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.securitycenter.v1.RunAssetDiscoveryResponse" + metadata_type: "google.protobuf.Empty" + }; + } + + // Updates the state of a finding. + rpc SetFindingState(SetFindingStateRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1/{name=organizations/*/sources/*/findings/*}:setState" + body: "*" + additional_bindings { + post: "/v1/{name=folders/*/sources/*/findings/*}:setState" + body: "*" + } + additional_bindings { + post: "/v1/{name=projects/*/sources/*/findings/*}:setState" + body: "*" + } + }; + option (google.api.method_signature) = "name,state,start_time"; + } + + // Updates the mute state of a finding. + rpc SetMute(SetMuteRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1/{name=organizations/*/sources/*/findings/*}:setMute" + body: "*" + additional_bindings { + post: "/v1/{name=folders/*/sources/*/findings/*}:setMute" + body: "*" + } + additional_bindings { + post: "/v1/{name=projects/*/sources/*/findings/*}:setMute" + body: "*" + } + }; + option (google.api.method_signature) = "name,mute"; + } + + // Sets the access control policy on the specified Source. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=organizations/*/sources/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Returns the permissions that a caller has on the specified source. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Updates external system. This is for a given finding. + rpc UpdateExternalSystem(UpdateExternalSystemRequest) + returns (ExternalSystem) { + option (google.api.http) = { + patch: "/v1/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}" + body: "external_system" + additional_bindings { + patch: "/v1/{external_system.name=folders/*/sources/*/findings/*/externalSystems/*}" + body: "external_system" + } + additional_bindings { + patch: "/v1/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}" + body: "external_system" + } + }; + option (google.api.method_signature) = "external_system,update_mask"; + } + + // Creates or updates a finding. The corresponding source must exist for a + // finding creation to succeed. + rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { + option (google.api.http) = { + patch: "/v1/{finding.name=organizations/*/sources/*/findings/*}" + body: "finding" + additional_bindings { + patch: "/v1/{finding.name=folders/*/sources/*/findings/*}" + body: "finding" + } + additional_bindings { + patch: "/v1/{finding.name=projects/*/sources/*/findings/*}" + body: "finding" + } + }; + option (google.api.method_signature) = "finding"; + } + + // Updates a mute config. + rpc UpdateMuteConfig(UpdateMuteConfigRequest) returns (MuteConfig) { + option (google.api.http) = { + patch: "/v1/{mute_config.name=organizations/*/muteConfigs/*}" + body: "mute_config" + additional_bindings { + patch: "/v1/{mute_config.name=folders/*/muteConfigs/*}" + body: "mute_config" + } + additional_bindings { + patch: "/v1/{mute_config.name=projects/*/muteConfigs/*}" + body: "mute_config" + } + }; + option (google.api.method_signature) = "mute_config,update_mask"; + } + + // + // Updates a notification config. The following update + // fields are allowed: description, pubsub_topic, streaming_config.filter + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + patch: "/v1/{notification_config.name=organizations/*/notificationConfigs/*}" + body: "notification_config" + additional_bindings { + patch: "/v1/{notification_config.name=folders/*/notificationConfigs/*}" + body: "notification_config" + } + additional_bindings { + patch: "/v1/{notification_config.name=projects/*/notificationConfigs/*}" + body: "notification_config" + } + }; + option (google.api.method_signature) = "notification_config"; + option (google.api.method_signature) = "notification_config,update_mask"; + } + + // Updates an organization's settings. + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) + returns (OrganizationSettings) { + option (google.api.http) = { + patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" + body: "organization_settings" + }; + option (google.api.method_signature) = "organization_settings"; + } + + // Updates a source. + rpc UpdateSource(UpdateSourceRequest) returns (Source) { + option (google.api.http) = { + patch: "/v1/{source.name=organizations/*/sources/*}" + body: "source" + }; + option (google.api.method_signature) = "source"; + } + + // Updates security marks. + rpc UpdateSecurityMarks(UpdateSecurityMarksRequest) returns (SecurityMarks) { + option (google.api.http) = { + patch: "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}" + body: "security_marks" + additional_bindings { + patch: "/v1/{security_marks.name=folders/*/assets/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1/{security_marks.name=projects/*/assets/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + }; + option (google.api.method_signature) = "security_marks"; + } + + // Creates a big query export. + rpc CreateBigQueryExport(CreateBigQueryExportRequest) + returns (BigQueryExport) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/bigQueryExports" + body: "big_query_export" + additional_bindings { + post: "/v1/{parent=folders/*}/bigQueryExports" + body: "big_query_export" + } + additional_bindings { + post: "/v1/{parent=projects/*}/bigQueryExports" + body: "big_query_export" + } + }; + option (google.api.method_signature) = + "parent,big_query_export,big_query_export_id"; + } + + // Deletes an existing big query export. + rpc DeleteBigQueryExport(DeleteBigQueryExportRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/bigQueryExports/*}" + additional_bindings { delete: "/v1/{name=folders/*/bigQueryExports/*}" } + additional_bindings { delete: "/v1/{name=projects/*/bigQueryExports/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Updates a BigQuery export. + rpc UpdateBigQueryExport(UpdateBigQueryExportRequest) + returns (BigQueryExport) { + option (google.api.http) = { + patch: "/v1/{big_query_export.name=organizations/*/bigQueryExports/*}" + body: "big_query_export" + additional_bindings { + patch: "/v1/{big_query_export.name=folders/*/bigQueryExports/*}" + body: "big_query_export" + } + additional_bindings { + patch: "/v1/{big_query_export.name=projects/*/bigQueryExports/*}" + body: "big_query_export" + } + }; + option (google.api.method_signature) = "big_query_export,update_mask"; + } + + // Lists BigQuery exports. Note that when requesting BigQuery exports at a + // given level all exports under that level are also returned e.g. if + // requesting BigQuery exports under a folder, then all BigQuery exports + // immediately under the folder plus the ones created under the projects + // within the folder are returned. + rpc ListBigQueryExports(ListBigQueryExportsRequest) + returns (ListBigQueryExportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/bigQueryExports" + additional_bindings { get: "/v1/{parent=folders/*}/bigQueryExports" } + additional_bindings { get: "/v1/{parent=projects/*}/bigQueryExports" } + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for bulk findings update. +// +// Note: +// 1. If multiple bulk update requests match the same resource, the order in +// which they get executed is not defined. +// 2. Once a bulk operation is started, there is no way to stop it. +message BulkMuteFindingsRequest { + // Required. The parent, at which bulk action needs to be applied. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "*" } + ]; + + // Expression that identifies findings that should be updated. + // The expression is a list of zero or more restrictions combined + // via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + // has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a + // `-` character in front of them to indicate negation. The fields map to + // those defined in the corresponding resource. + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + string filter = 2; + + // This can be a mute configuration name or any identifier for mute/unmute + // of findings based on the filter. + string mute_annotation = 3 [deprecated = true]; +} + +// The response to a BulkMute request. Contains the LRO information. +message BulkMuteFindingsResponse {} + +// Request message for creating a finding. +message CreateFindingRequest { + // Required. Resource name of the new finding's parent. Its format should be + // "organizations/[organization_id]/sources/[source_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Required. Unique identifier provided by the client within the parent scope. + // It must be alphanumeric and less than or equal to 32 characters and + // greater than 0 characters in length. + string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Finding being created. The name and security_marks will be + // ignored as they are both output only fields on this resource. + Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for creating a mute config. +message CreateMuteConfigRequest { + // Required. Resource name of the new mute configs's parent. Its format is + // "organizations/[organization_id]", "folders/[folder_id]", or + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/MuteConfig" + } + ]; + + // Required. The mute config being created. + MuteConfig mute_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Unique identifier provided by the client within the parent scope. + // It must consist of lower case letters, numbers, and hyphen, with the first + // character a letter, the last a letter or a number, and a 63 character + // maximum. + string mute_config_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for creating a notification config. +message CreateNotificationConfigRequest { + // Required. Resource name of the new notification config's parent. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", or + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; + + // Required. + // Unique identifier provided by the client within the parent scope. + // It must be between 1 and 128 characters, and contains alphanumeric + // characters, underscores or hyphens only. + string config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The notification config being created. The name and the service + // account will be ignored as they are both output only fields on this + // resource. + NotificationConfig notification_config = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for creating a source. +message CreateSourceRequest { + // Required. Resource name of the new source's parent. Its format should be + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Required. The Source being created, only the display_name and description + // will be used. All other fields will be ignored. + Source source = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for deleting a mute config. +message DeleteMuteConfigRequest { + // Required. Name of the mute config to delete. Its format is + // organizations/{organization}/muteConfigs/{config_id}, + // folders/{folder}/muteConfigs/{config_id}, or + // projects/{project}/muteConfigs/{config_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/MuteConfig" + } + ]; +} + +// Request message for deleting a notification config. +message DeleteNotificationConfigRequest { + // Required. Name of the notification config to delete. Its format is + // "organizations/[organization_id]/notificationConfigs/[config_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + +// Request message for retrieving a big query export. +message GetBigQueryExportRequest { + // Required. Name of the big query export to retrieve. Its format is + // organizations/{organization}/bigQueryExports/{export_id}, + // folders/{folder}/bigQueryExports/{export_id}, or + // projects/{project}/bigQueryExports/{export_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/BigQueryExport" + } + ]; +} + +// Request message for retrieving a mute config. +message GetMuteConfigRequest { + // Required. Name of the mute config to retrieve. Its format is + // organizations/{organization}/muteConfigs/{config_id}, + // folders/{folder}/muteConfigs/{config_id}, or + // projects/{project}/muteConfigs/{config_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/MuteConfig" + } + ]; +} + +// Request message for getting a notification config. +message GetNotificationConfigRequest { + // Required. Name of the notification config to get. Its format is + // "organizations/[organization_id]/notificationConfigs/[config_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + +// Request message for getting organization settings. +message GetOrganizationSettingsRequest { + // Required. Name of the organization to get organization settings for. Its + // format is "organizations/[organization_id]/organizationSettings". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + } + ]; +} + +// Request message for getting a source. +message GetSourceRequest { + // Required. Relative resource name of the source. Its format is + // "organizations/[organization_id]/source/[source_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; +} + +// Request message for grouping by assets. +message GroupAssetsRequest { + // Required. Name of the organization to groupBy. Its format is + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/Asset" + } + ]; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following field and operator combinations are supported: + // + // * name: `=` + // * update_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // `update_time = "2019-06-10T16:07:18-07:00"` + // `update_time = 1560208038000` + // + // * create_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // `create_time = "2019-06-10T16:07:18-07:00"` + // `create_time = 1560208038000` + // + // * iam_policy.policy_blob: `=`, `:` + // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // * security_marks.marks: `=`, `:` + // * security_center_properties.resource_name: `=`, `:` + // * security_center_properties.resource_display_name: `=`, `:` + // * security_center_properties.resource_type: `=`, `:` + // * security_center_properties.resource_parent: `=`, `:` + // * security_center_properties.resource_parent_display_name: `=`, `:` + // * security_center_properties.resource_project: `=`, `:` + // * security_center_properties.resource_project_display_name: `=`, `:` + // * security_center_properties.resource_owners: `=`, `:` + // + // For example, `resource_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `resource_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-resource_properties.my_property : ""` + string filter = 2; + + // Required. Expression that defines what assets fields to use for grouping. + // The string value should follow SQL syntax: comma separated list of fields. + // For example: + // "security_center_properties.resource_project,security_center_properties.project". + // + // The following fields are supported when compare_duration is not set: + // + // * security_center_properties.resource_project + // * security_center_properties.resource_project_display_name + // * security_center_properties.resource_type + // * security_center_properties.resource_parent + // * security_center_properties.resource_parent_display_name + // + // The following fields are supported when compare_duration is set: + // + // * security_center_properties.resource_type + // * security_center_properties.resource_project_display_name + // * security_center_properties.resource_parent_display_name + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; + + // When compare_duration is set, the GroupResult's "state_change" property is + // updated to indicate whether the asset was added, removed, or remained + // present during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state change value is derived based on the presence of the asset at the + // two points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present at the start of + // compare_duration, but present at reference_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at reference_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and reference_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all assets present at + // read_time. + // + // If this field is set then `state_change` must be a specified field in + // `group_by`. + google.protobuf.Duration compare_duration = 4; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 5; + + // The value returned by the last `GroupAssetsResponse`; indicates + // that this is a continuation of a prior `GroupAssets` call, and that the + // system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for grouping by assets. +message GroupAssetsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of results matching the query. + int32 total_size = 4; +} + +// Request message for grouping by findings. +message GroupFindingsRequest { + // Required. Name of the source to groupBy. Its format is + // "organizations/[organization_id]/sources/[source_id]", + // folders/[folder_id]/sources/[source_id], or + // projects/[project_id]/sources/[source_id]. To groupBy across all sources + // provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + // or projects/{project_id}/sources/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following field and operator combinations are supported: + // + // * name: `=` + // * parent: `=`, `:` + // * resource_name: `=`, `:` + // * state: `=`, `:` + // * category: `=`, `:` + // * external_uri: `=`, `:` + // * event_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // `event_time = "2019-06-10T16:07:18-07:00"` + // `event_time = 1560208038000` + // + // * severity: `=`, `:` + // * workflow_state: `=`, `:` + // * security_marks.marks: `=`, `:` + // * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // + // For example, `source_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `source_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-source_properties.my_property : ""` + // + // * resource: + // * resource.name: `=`, `:` + // * resource.parent_name: `=`, `:` + // * resource.parent_display_name: `=`, `:` + // * resource.project_name: `=`, `:` + // * resource.project_display_name: `=`, `:` + // * resource.type: `=`, `:` + string filter = 2; + + // Required. Expression that defines what assets fields to use for grouping + // (including `state_change`). The string value should follow SQL syntax: + // comma separated list of fields. For example: "parent,resource_name". + // + // The following fields are supported: + // + // * resource_name + // * category + // * state + // * parent + // * severity + // + // The following fields are supported when compare_duration is set: + // + // * state_change + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the GroupResult's "state_change" attribute is + // updated to indicate whether the finding had its state changed, the + // finding's state remained unchanged, or if the finding was added during the + // compare_duration period of time that precedes the read_time. This is the + // time between (read_time - compare_duration) and read_time. + // + // The state_change value is derived based on the presence and state of the + // finding at the two points in time. Intermediate state changes between the + // two times don't affect the result. For example, the results aren't affected + // if the finding is made inactive and then active again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "CHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration, but changed its + // state at read_time. + // * "UNCHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration and did not change + // state at read_time. + // * "ADDED": indicates that the finding did not match the given filter or + // was not present at the start of compare_duration, but was + // present at read_time. + // * "REMOVED": indicates that the finding was present and matched the + // filter at the start of compare_duration, but did not match + // the filter at read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all findings present + // at read_time. + // + // If this field is set then `state_change` must be a specified field in + // `group_by`. + google.protobuf.Duration compare_duration = 5; + + // The value returned by the last `GroupFindingsResponse`; indicates + // that this is a continuation of a prior `GroupFindings` call, and + // that the system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for group by findings. +message GroupFindingsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of results matching the query. + int32 total_size = 4; +} + +// Result containing the properties and count of a groupBy request. +message GroupResult { + // Properties matching the groupBy fields in the request. + map properties = 1; + + // Total count of resources for the given properties. + int64 count = 2; +} + +// Request message for listing mute configs at a given scope e.g. organization, +// folder or project. +message ListMuteConfigsRequest { + // Required. The parent, which owns the collection of mute configs. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/MuteConfig" + } + ]; + + // The maximum number of configs to return. The service may return fewer than + // this value. + // If unspecified, at most 10 configs will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListMuteConfigs` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListMuteConfigs` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for listing mute configs. +message ListMuteConfigsResponse { + // The mute configs from the specified parent. + repeated MuteConfig mute_configs = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for listing notification configs. +message ListNotificationConfigsRequest { + // Required. Name of the organization to list notification configs. Its format + // is "organizations/[organization_id]", "folders/[folder_id]", or + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; + + // The value returned by the last `ListNotificationConfigsResponse`; indicates + // that this is a continuation of a prior `ListNotificationConfigs` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 3; +} + +// Response message for listing notification configs. +message ListNotificationConfigsResponse { + // Notification configs belonging to the requested parent. + repeated NotificationConfig notification_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + +// Request message for listing sources. +message ListSourcesRequest { + // Required. Resource name of the parent of sources to list. Its format should + // be "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/Source" + } + ]; + + // The value returned by the last `ListSourcesResponse`; indicates + // that this is a continuation of a prior `ListSources` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 7; +} + +// Response message for listing sources. +message ListSourcesResponse { + // Sources belonging to the requested parent. + repeated Source sources = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + +// Request message for listing assets. +message ListAssetsRequest { + // Required. Name of the organization assets should belong to. Its format is + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/Asset" + } + ]; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following are the allowed field and operator combinations: + // + // * name: `=` + // * update_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // `update_time = "2019-06-10T16:07:18-07:00"` + // `update_time = 1560208038000` + // + // * create_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // `create_time = "2019-06-10T16:07:18-07:00"` + // `create_time = 1560208038000` + // + // * iam_policy.policy_blob: `=`, `:` + // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // * security_marks.marks: `=`, `:` + // * security_center_properties.resource_name: `=`, `:` + // * security_center_properties.resource_display_name: `=`, `:` + // * security_center_properties.resource_type: `=`, `:` + // * security_center_properties.resource_parent: `=`, `:` + // * security_center_properties.resource_parent_display_name: `=`, `:` + // * security_center_properties.resource_project: `=`, `:` + // * security_center_properties.resource_project_display_name: `=`, `:` + // * security_center_properties.resource_owners: `=`, `:` + // + // For example, `resource_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `resource_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-resource_properties.my_property : ""` + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,resource_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,resource_properties.a_property" and " + // name desc , resource_properties.a_property " are equivalent. + // + // The following fields are supported: + // name + // update_time + // resource_properties + // security_marks.marks + // security_center_properties.resource_name + // security_center_properties.resource_display_name + // security_center_properties.resource_parent + // security_center_properties.resource_parent_display_name + // security_center_properties.resource_project + // security_center_properties.resource_project_display_name + // security_center_properties.resource_type + string order_by = 3; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListAssetsResult's "state_change" + // attribute is updated to indicate whether the asset was added, removed, or + // remained present during the compare_duration period of time that precedes + // the read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state_change value is derived based on the presence of the asset at the + // two points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present at the start of + // compare_duration, but present at read_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at read_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all assets present at + // read_time. + google.protobuf.Duration compare_duration = 5; + + // A field mask to specify the ListAssetsResult fields to be listed in the + // response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7; + + // The value returned by the last `ListAssetsResponse`; indicates + // that this is a continuation of a prior `ListAssets` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing assets. +message ListAssetsResponse { + // Result containing the Asset and its State. + message ListAssetsResult { + // The change in state of the asset. + // + // When querying across two points in time this describes + // the change between the two points: ADDED, REMOVED, or ACTIVE. + // If there was no compare_duration supplied in the request the state change + // will be: UNUSED + enum StateChange { + // State change is unused, this is the canonical default for this enum. + UNUSED = 0; + + // Asset was added between the points in time. + ADDED = 1; + + // Asset was removed between the points in time. + REMOVED = 2; + + // Asset was present at both point(s) in time. + ACTIVE = 3; + } + + // Asset matching the search request. + Asset asset = 1; + + // State change of the asset between the points in time. + StateChange state_change = 2; + } + + // Assets matching the list request. + repeated ListAssetsResult list_assets_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of assets matching the query. + int32 total_size = 4; +} + +// Request message for listing findings. +message ListFindingsRequest { + // Required. Name of the source the findings belong to. Its format is + // "organizations/[organization_id]/sources/[source_id], + // folders/[folder_id]/sources/[source_id], or + // projects/[project_id]/sources/[source_id]". To list across all sources + // provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + // projects/{projects_id}/sources/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following field and operator combinations are supported: + // + // * name: `=` + // * parent: `=`, `:` + // * resource_name: `=`, `:` + // * state: `=`, `:` + // * category: `=`, `:` + // * external_uri: `=`, `:` + // * event_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // `event_time = "2019-06-10T16:07:18-07:00"` + // `event_time = 1560208038000` + // + // * severity: `=`, `:` + // * workflow_state: `=`, `:` + // * security_marks.marks: `=`, `:` + // * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // + // For example, `source_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `source_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-source_properties.my_property : ""` + // + // * resource: + // * resource.name: `=`, `:` + // * resource.parent_name: `=`, `:` + // * resource.parent_display_name: `=`, `:` + // * resource.project_name: `=`, `:` + // * resource.project_display_name: `=`, `:` + // * resource.type: `=`, `:` + // * resource.folders.resource_folder: `=`, `:` + // * resource.display_name: `=`, `:` + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,source_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,source_properties.a_property" and " + // name desc , source_properties.a_property " are equivalent. + // + // The following fields are supported: + // name + // parent + // state + // category + // resource_name + // event_time + // source_properties + // security_marks.marks + string order_by = 3; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListFindingsResult's "state_change" + // attribute is updated to indicate whether the finding had its state changed, + // the finding's state remained unchanged, or if the finding was added in any + // state during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state_change value is derived based on the presence and state of the + // finding at the two points in time. Intermediate state changes between the + // two times don't affect the result. For example, the results aren't affected + // if the finding is made inactive and then active again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "CHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration, but changed its + // state at read_time. + // * "UNCHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration and did not change + // state at read_time. + // * "ADDED": indicates that the finding did not match the given filter or + // was not present at the start of compare_duration, but was + // present at read_time. + // * "REMOVED": indicates that the finding was present and matched the + // filter at the start of compare_duration, but did not match + // the filter at read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all findings present at + // read_time. + google.protobuf.Duration compare_duration = 5; + + // A field mask to specify the Finding fields to be listed in the response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7; + + // The value returned by the last `ListFindingsResponse`; indicates + // that this is a continuation of a prior `ListFindings` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing findings. +message ListFindingsResponse { + // Result containing the Finding and its StateChange. + message ListFindingsResult { + // The change in state of the finding. + // + // When querying across two points in time this describes + // the change in the finding between the two points: CHANGED, UNCHANGED, + // ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that + // the finding at timestamp does not match the filter specified, but it did + // at timestamp - compare_duration. If there was no compare_duration + // supplied in the request the state change will be: UNUSED + enum StateChange { + // State change is unused, this is the canonical default for this enum. + UNUSED = 0; + + // The finding has changed state in some way between the points in time + // and existed at both points. + CHANGED = 1; + + // The finding has not changed state between the points in time and + // existed at both points. + UNCHANGED = 2; + + // The finding was created between the points in time. + ADDED = 3; + + // The finding at timestamp does not match the filter specified, but it + // did at timestamp - compare_duration. + REMOVED = 4; + } + + // Information related to the Google Cloud resource that is + // associated with this finding. + message Resource { + // The full resource name of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string name = 1; + + // The human readable name of the resource. + string display_name = 8; + + // The full resource type of the resource. + string type = 6; + + // The full resource name of project that the resource belongs to. + string project_name = 2; + + // The project ID that the resource belongs to. + string project_display_name = 3; + + // The full resource name of resource's parent. + string parent_name = 4; + + // The human readable name of resource's parent. + string parent_display_name = 5; + + // Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is + // the folder directly under the Organization. + repeated Folder folders = 7; + } + + // Finding matching the search request. + Finding finding = 1; + + // State change of the finding between the points in time. + StateChange state_change = 2; + + // Output only. Resource that is associated with this finding. + Resource resource = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Findings matching the list request. + repeated ListFindingsResult list_findings_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of findings matching the query. + int32 total_size = 4; +} + +// Request message for updating a finding's state. +message SetFindingStateRequest { + // Required. The relative resource name of the finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Finding" + } + ]; + + // Required. The desired State of the finding. + Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The time at which the updated state takes effect. + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for updating a finding's mute status. +message SetMuteRequest { + // Required. The relative resource name of the finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + // "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + // "projects/{project_id}/sources/{source_id}/findings/{finding_id}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Finding" + } + ]; + + // Required. The desired state of the Mute. + Finding.Mute mute = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for running asset discovery for an organization. +message RunAssetDiscoveryRequest { + // Required. Name of the organization to run asset discovery for. Its format + // is "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; +} + +// Request message for updating a ExternalSystem resource. +message UpdateExternalSystemRequest { + // Required. The external system resource to update. + ExternalSystem external_system = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the external system resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating or creating a finding. +message UpdateFindingRequest { + // Required. The finding resource to update or create if it does not already + // exist. parent, security_marks, and update_time will be ignored. + // + // In the case of creation, the finding id portion of the name must be + // alphanumeric and less than or equal to 32 characters and greater than 0 + // characters in length. + Finding finding = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the finding resource. This field should + // not be specified when creating a finding. + // + // When updating a finding, an empty mask is treated as updating all mutable + // fields and replacing source_properties. Individual source_properties can + // be added/updated by using "source_properties." in the field + // mask. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a mute config. +message UpdateMuteConfigRequest { + // Required. The mute config being updated. + MuteConfig mute_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a notification config. +message UpdateNotificationConfigRequest { + // Required. The notification config to update. + NotificationConfig notification_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the notification config. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating an organization's settings. +message UpdateOrganizationSettingsRequest { + // Required. The organization settings resource to update. + OrganizationSettings organization_settings = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the settings resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a source. +message UpdateSourceRequest { + // Required. The source resource to update. + Source source = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the source resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a SecurityMarks resource. +message UpdateSecurityMarksRequest { + // Required. The security marks resource to update. + SecurityMarks security_marks = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the security marks resource. + // + // The field mask must not contain duplicate fields. + // If empty or set to "marks", all marks will be replaced. Individual + // marks can be updated using "marks.". + google.protobuf.FieldMask update_mask = 2; + + // The time at which the updated SecurityMarks take effect. + // If not set uses current server time. Updates will be applied to the + // SecurityMarks that are active immediately preceding this time. Must be + // earlier or equal to the server time. + google.protobuf.Timestamp start_time = 3; +} + +// Request message for creating a big query export. +message CreateBigQueryExportRequest { + // Required. Resource name of the new big query export's parent. Its format is + // "organizations/[organization_id]", "folders/[folder_id]", or + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/BigQueryExport" + } + ]; + + // Required. The big query export being created. + BigQueryExport big_query_export = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Unique identifier provided by the client within the parent scope. + // It must consist of lower case letters, numbers, and hyphen, with the first + // character a letter, the last a letter or a number, and a 63 character + // maximum. + string big_query_export_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for updating a BigQuery export. +message UpdateBigQueryExportRequest { + // Required. The BigQuery export being updated. + BigQueryExport big_query_export = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for listing BigQuery exports at a given scope e.g. +// organization, folder or project. +message ListBigQueryExportsRequest { + // Required. The parent, which owns the collection of BigQuery exports. Its + // format is "organizations/[organization_id]", "folders/[folder_id]", + // "projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/BigQueryExport" + } + ]; + + // The maximum number of configs to return. The service may return fewer than + // this value. + // If unspecified, at most 10 configs will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListBigQueryExports` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListBigQueryExports` + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for listing BigQuery exports. +message ListBigQueryExportsResponse { + // The BigQuery exports from the specified parent. + repeated BigQueryExport big_query_exports = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for deleting a big query export. +message DeleteBigQueryExportRequest { + // Required. Name of the big query export to delete. Its format is + // organizations/{organization}/bigQueryExports/{export_id}, + // folders/{folder}/bigQueryExports/{export_id}, or + // projects/{project}/bigQueryExports/{export_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/BigQueryExport" + } + ]; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto new file mode 100644 index 00000000000..75c069a1ccc --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/source.proto @@ -0,0 +1,69 @@ +// 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.securitycenter.v1; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Security Command Center finding source. A finding source +// is an entity or a mechanism that can produce a finding. A source is like a +// container of findings that come from the same scanner, logger, monitor, and +// other tools. +message Source { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Source" + pattern: "organizations/{organization}/sources/{source}" + pattern: "folders/{folder}/sources/{source}" + pattern: "projects/{project}/sources/{source}" + }; + + // The relative resource name of this source. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}" + string name = 1; + + // The source's display name. + // A source's display name must be unique amongst its siblings, for example, + // two sources with the same parent can't share the same display name. + // The display name must have a length between 1 and 64 characters + // (inclusive). + string display_name = 2; + + // The description of the source (max of 1024 characters). + // Example: + // "Web Security Scanner is a web security scanner for common + // vulnerabilities in App Engine applications. It can automatically + // scan and detect four common vulnerabilities, including cross-site-scripting + // (XSS), Flash injection, mixed content (HTTP in HTTPS), and + // outdated or insecure libraries." + string description = 3; + + // The canonical name of the finding. It's either + // "organizations/{organization_id}/sources/{source_id}", + // "folders/{folder_id}/sources/{source_id}" or + // "projects/{project_number}/sources/{source_id}", + // depending on the closest CRM ancestor of the resource associated with the + // finding. + string canonical_name = 14; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto new file mode 100644 index 00000000000..3810d90c705 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/vulnerability.proto @@ -0,0 +1,216 @@ +// 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "VulnerabilityProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Refers to common vulnerability fields e.g. cve, cvss, cwe etc. +message Vulnerability { + // CVE stands for Common Vulnerabilities and Exposures + // (https://cve.mitre.org/about/) + Cve cve = 1; +} + +// CVE stands for Common Vulnerabilities and Exposures. +// More information: https://cve.mitre.org +message Cve { + // The unique identifier for the vulnerability. e.g. CVE-2021-34527 + string id = 1; + + // Additional information about the CVE. + // e.g. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527 + repeated Reference references = 2; + + // Describe Common Vulnerability Scoring System specified at + // https://www.first.org/cvss/v3.1/specification-document + Cvssv3 cvssv3 = 3; + + // Whether upstream fix is available for the CVE. + bool upstream_fix_available = 4; +} + +// Additional Links +message Reference { + // Source of the reference e.g. NVD + string source = 1; + + // Uri for the mentioned source e.g. + // https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527. + string uri = 2; +} + +// Common Vulnerability Scoring System version 3. +message Cvssv3 { + // This metric reflects the context by which vulnerability exploitation is + // possible. + enum AttackVector { + // Invalid value. + ATTACK_VECTOR_UNSPECIFIED = 0; + + // The vulnerable component is bound to the network stack and the set of + // possible attackers extends beyond the other options listed below, up to + // and including the entire Internet. + ATTACK_VECTOR_NETWORK = 1; + + // The vulnerable component is bound to the network stack, but the attack is + // limited at the protocol level to a logically adjacent topology. + ATTACK_VECTOR_ADJACENT = 2; + + // The vulnerable component is not bound to the network stack and the + // attacker's path is via read/write/execute capabilities. + ATTACK_VECTOR_LOCAL = 3; + + // The attack requires the attacker to physically touch or manipulate the + // vulnerable component. + ATTACK_VECTOR_PHYSICAL = 4; + } + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + enum AttackComplexity { + // Invalid value. + ATTACK_COMPLEXITY_UNSPECIFIED = 0; + + // Specialized access conditions or extenuating circumstances do not exist. + // An attacker can expect repeatable success when attacking the vulnerable + // component. + ATTACK_COMPLEXITY_LOW = 1; + + // A successful attack depends on conditions beyond the attacker's control. + // That is, a successful attack cannot be accomplished at will, but requires + // the attacker to invest in some measurable amount of effort in preparation + // or execution against the vulnerable component before a successful attack + // can be expected. + ATTACK_COMPLEXITY_HIGH = 2; + } + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + enum PrivilegesRequired { + // Invalid value. + PRIVILEGES_REQUIRED_UNSPECIFIED = 0; + + // The attacker is unauthorized prior to attack, and therefore does not + // require any access to settings or files of the vulnerable system to + // carry out an attack. + PRIVILEGES_REQUIRED_NONE = 1; + + // The attacker requires privileges that provide basic user capabilities + // that could normally affect only settings and files owned by a user. + // Alternatively, an attacker with Low privileges has the ability to access + // only non-sensitive resources. + PRIVILEGES_REQUIRED_LOW = 2; + + // The attacker requires privileges that provide significant (e.g., + // administrative) control over the vulnerable component allowing access to + // component-wide settings and files. + PRIVILEGES_REQUIRED_HIGH = 3; + } + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + enum UserInteraction { + // Invalid value. + USER_INTERACTION_UNSPECIFIED = 0; + + // The vulnerable system can be exploited without interaction from any user. + USER_INTERACTION_NONE = 1; + + // Successful exploitation of this vulnerability requires a user to take + // some action before the vulnerability can be exploited. + USER_INTERACTION_REQUIRED = 2; + } + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + enum Scope { + // Invalid value. + SCOPE_UNSPECIFIED = 0; + + // An exploited vulnerability can only affect resources managed by the same + // security authority. + SCOPE_UNCHANGED = 1; + + // An exploited vulnerability can affect resources beyond the security scope + // managed by the security authority of the vulnerable component. + SCOPE_CHANGED = 2; + } + + // The Impact metrics capture the effects of a successfully exploited + // vulnerability on the component that suffers the worst outcome that is most + // directly and predictably associated with the attack. + enum Impact { + // Invalid value. + IMPACT_UNSPECIFIED = 0; + + // High impact. + IMPACT_HIGH = 1; + + // Low impact. + IMPACT_LOW = 2; + + // No impact. + IMPACT_NONE = 3; + } + + // The base score is a function of the base metric scores. + double base_score = 1; + + // Base Metrics + // Represents the intrinsic characteristics of a vulnerability that are + // constant over time and across user environments. + // This metric reflects the context by which vulnerability exploitation is + // possible. + AttackVector attack_vector = 5; + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + AttackComplexity attack_complexity = 6; + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + PrivilegesRequired privileges_required = 7; + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + UserInteraction user_interaction = 8; + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + Scope scope = 9; + + // This metric measures the impact to the confidentiality of the information + // resources managed by a software component due to a successfully exploited + // vulnerability. + Impact confidentiality_impact = 10; + + // This metric measures the impact to integrity of a successfully exploited + // vulnerability. + Impact integrity_impact = 11; + + // This metric measures the impact to the availability of the impacted + // component resulting from a successfully exploited vulnerability. + Impact availability_impact = 12; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto new file mode 100644 index 00000000000..415e7a2f094 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/asset.proto @@ -0,0 +1,92 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1beta1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// Security Command Center representation of a Google Cloud +// resource. +// +// The Asset is a Security Command Center resource that captures information +// about a single Google Cloud resource. All modifications to an Asset are only +// within the context of Security Command Center and don't affect the referenced +// Google Cloud resource. +message Asset { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Asset" + pattern: "organizations/{organization}/assets/{asset}" + }; + + // Security Command Center managed properties. These properties are managed by + // Security Command Center and cannot be modified by the user. + message SecurityCenterProperties { + // Immutable. The full resource name of the Google Cloud resource this asset + // represents. This field is immutable after create time. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // The type of the Google Cloud resource. Examples include: APPLICATION, + // PROJECT, and ORGANIZATION. This is a case insensitive field defined by + // Security Command Center and/or the producer of the resource and is + // immutable after create time. + string resource_type = 2; + + // The full resource name of the immediate parent of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_parent = 3; + + // The full resource name of the project the resource belongs to. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_project = 4; + + // Owners of the Google Cloud resource. + repeated string resource_owners = 5; + } + + // The relative resource name of this asset. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/assets/{asset_id}". + string name = 1; + + // Security Command Center managed properties. These properties are managed by + // Security Command Center and cannot be modified by the user. + SecurityCenterProperties security_center_properties = 2; + + // Resource managed properties. These properties are managed and defined by + // the Google Cloud resource and cannot be modified by the user. + map resource_properties = 7; + + // User specified security marks. These marks are entirely managed by the user + // and come from the SecurityMarks resource that belongs to the asset. + SecurityMarks security_marks = 8; + + // The time at which the asset was created in Security Command Center. + google.protobuf.Timestamp create_time = 9; + + // The time at which the asset was last updated, added, or deleted in Security + // Command Center. + google.protobuf.Timestamp update_time = 10; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto new file mode 100644 index 00000000000..768bf411c7e --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/finding.proto @@ -0,0 +1,109 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1beta1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// Security Command Center finding. +// +// A finding is a record of assessment data (security, risk, health or privacy) +// ingested into Security Command Center for presentation, notification, +// analysis, policy testing, and enforcement. For example, an XSS vulnerability +// in an App Engine application is a finding. +message Finding { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Finding" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}" + }; + + // The state of the finding. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // The finding requires attention and has not been addressed yet. + ACTIVE = 1; + + // The finding has been fixed, triaged as a non-issue or otherwise addressed + // and is no longer active. + INACTIVE = 2; + } + + // The relative resource name of this finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" + string name = 1; + + // Immutable. The relative resource name of the source the finding belongs to. + // See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // This field is immutable after creation time. + // For example: + // "organizations/{organization_id}/sources/{source_id}" + string parent = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // For findings on Google Cloud resources, the full resource + // name of the Google Cloud resource this finding is for. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + // When the finding is for a non-Google Cloud resource, the resourceName can + // be a customer or partner defined string. This field is immutable after + // creation time. + string resource_name = 3; + + // The state of the finding. + State state = 4; + + // The additional taxonomy group within findings from a given source. + // This field is immutable after creation time. + // Example: "XSS_FLASH_INJECTION" + string category = 5; + + // The URI that, if available, points to a web page outside of Security + // Command Center where additional information about the finding can be found. + // This field is guaranteed to be either empty or a well formed URL. + string external_uri = 6; + + // Source specific properties. These properties are managed by the source + // that writes the finding. The key names in the source_properties map must be + // between 1 and 255 characters, and must start with a letter and contain + // alphanumeric characters or underscores only. + map source_properties = 7; + + // Output only. User specified security marks. These marks are entirely + // managed by the user and come from the SecurityMarks resource that belongs + // to the finding. + SecurityMarks security_marks = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The time at which the event took place, or when an update to the finding + // occurred. For example, if the finding represents an open firewall it would + // capture the time the detector believes the firewall became open. The + // accuracy is determined by the detector. If the finding were to be resolved + // afterward, this time would reflect when the finding was resolved. + google.protobuf.Timestamp event_time = 9; + + // The time at which the finding was created in Security Command Center. + google.protobuf.Timestamp create_time = 10; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto new file mode 100644 index 00000000000..b447bf6e39d --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/organization_settings.proto @@ -0,0 +1,78 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// User specified settings that are attached to the Security Command +// Center organization. +message OrganizationSettings { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + pattern: "organizations/{organization}/organizationSettings" + }; + + // The configuration used for Asset Discovery runs. + message AssetDiscoveryConfig { + // The mode of inclusion when running Asset Discovery. + // Asset discovery can be limited by explicitly identifying projects to be + // included or excluded. If INCLUDE_ONLY is set, then only those projects + // within the organization and their children are discovered during asset + // discovery. If EXCLUDE is set, then projects that don't match those + // projects are discovered during asset discovery. If neither are set, then + // all projects within the organization are discovered during asset + // discovery. + enum InclusionMode { + // Unspecified. Setting the mode with this value will disable + // inclusion/exclusion filtering for Asset Discovery. + INCLUSION_MODE_UNSPECIFIED = 0; + + // Asset Discovery will capture only the resources within the projects + // specified. All other resources will be ignored. + INCLUDE_ONLY = 1; + + // Asset Discovery will ignore all resources under the projects specified. + // All other resources will be retrieved. + EXCLUDE = 2; + } + + // The project ids to use for filtering asset discovery. + repeated string project_ids = 1; + + // The mode to use for filtering asset discovery. + InclusionMode inclusion_mode = 2; + } + + // The relative resource name of the settings. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/organizationSettings". + string name = 1; + + // A flag that indicates if Asset Discovery should be enabled. If the flag is + // set to `true`, then discovery of assets will occur. If it is set to `false, + // all historical assets will remain, but discovery of future assets will not + // occur. + bool enable_asset_discovery = 2; + + // The configuration used for Asset Discovery runs. + AssetDiscoveryConfig asset_discovery_config = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto new file mode 100644 index 00000000000..cab92d902c3 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto @@ -0,0 +1,48 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/protobuf/duration.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// Response of asset discovery run +message RunAssetDiscoveryResponse { + // The state of an asset discovery run. + enum State { + // Asset discovery run state was unspecified. + STATE_UNSPECIFIED = 0; + + // Asset discovery run completed successfully. + COMPLETED = 1; + + // Asset discovery run was cancelled with tasks still pending, as another + // run for the same organization was started with a higher priority. + SUPERSEDED = 2; + + // Asset discovery run was killed and terminated. + TERMINATED = 3; + } + + // The state of an asset discovery run. + State state = 1; + + // The duration between asset discovery run start and end + google.protobuf.Duration duration = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto new file mode 100644 index 00000000000..f1dc88d7cd4 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/security_marks.proto @@ -0,0 +1,52 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// User specified security marks that are attached to the parent Security +// Command Center resource. Security marks are scoped within a Security Command +// Center organization -- they can be modified and viewed by all users who have +// proper permissions on the organization. +message SecurityMarks { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/SecurityMarks" + pattern: "organizations/{organization}/assets/{asset}/securityMarks" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + }; + + // The relative resource name of the SecurityMarks. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Examples: + // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". + string name = 1; + + // Mutable user specified security marks belonging to the parent resource. + // Constraints are as follows: + // + // * Keys and values are treated as case insensitive + // * Keys must be between 1 - 256 characters (inclusive) + // * Keys must be letters, numbers, underscores, or dashes + // * Values have leading and trailing whitespace trimmed, remaining + // characters must be between 1 - 4096 characters (inclusive) + map marks = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto new file mode 100644 index 00000000000..55276ef7f1c --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto @@ -0,0 +1,823 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1beta1/asset.proto"; +import "google/cloud/securitycenter/v1beta1/finding.proto"; +import "google/cloud/securitycenter/v1beta1/organization_settings.proto"; +import "google/cloud/securitycenter/v1beta1/security_marks.proto"; +import "google/cloud/securitycenter/v1beta1/source.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// V1 Beta APIs for Security Center service. +service SecurityCenter { + option (google.api.default_host) = "securitycenter.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a source. + rpc CreateSource(CreateSourceRequest) returns (Source) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*}/sources" + body: "source" + }; + option (google.api.method_signature) = "parent,source"; + } + + // Creates a finding. The corresponding source must exist for finding creation + // to succeed. + rpc CreateFinding(CreateFindingRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*/sources/*}/findings" + body: "finding" + }; + option (google.api.method_signature) = "parent,finding_id,finding"; + } + + // Gets the access control policy on the specified Source. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1beta1/{resource=organizations/*/sources/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Gets the settings for an organization. + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { + option (google.api.http) = { + get: "/v1beta1/{name=organizations/*/organizationSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a source. + rpc GetSource(GetSourceRequest) returns (Source) { + option (google.api.http) = { + get: "/v1beta1/{name=organizations/*/sources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Filters an organization's assets and groups them by their specified + // properties. + rpc GroupAssets(GroupAssetsRequest) returns (GroupAssetsResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*}/assets:group" + body: "*" + }; + } + + // Filters an organization or source's findings and groups them by their + // specified properties. + // + // To group across all sources provide a `-` as the source id. + // Example: /v1beta1/organizations/{organization_id}/sources/-/findings + rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*/sources/*}/findings:group" + body: "*" + }; + option (google.api.method_signature) = "parent,group_by"; + } + + // Lists an organization's assets. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=organizations/*}/assets" + }; + } + + // Lists an organization or source's findings. + // + // To list across all sources provide a `-` as the source id. + // Example: /v1beta1/organizations/{organization_id}/sources/-/findings + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=organizations/*/sources/*}/findings" + }; + } + + // Lists all sources belonging to an organization. + rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=organizations/*}/sources" + }; + option (google.api.method_signature) = "parent"; + } + + // Runs asset discovery. The discovery is tracked with a long-running + // operation. + // + // This API can only be called with limited frequency for an organization. If + // it is called too frequently the caller will receive a TOO_MANY_REQUESTS + // error. + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*}/assets:runDiscovery" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Empty" + }; + } + + // Updates the state of a finding. + rpc SetFindingState(SetFindingStateRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1beta1/{name=organizations/*/sources/*/findings/*}:setState" + body: "*" + }; + option (google.api.method_signature) = "name,state,start_time"; + } + + // Sets the access control policy on the specified Source. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1beta1/{resource=organizations/*/sources/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Returns the permissions that a caller has on the specified source. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1beta1/{resource=organizations/*/sources/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Creates or updates a finding. The corresponding source must exist for a + // finding creation to succeed. + rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { + option (google.api.http) = { + patch: "/v1beta1/{finding.name=organizations/*/sources/*/findings/*}" + body: "finding" + }; + option (google.api.method_signature) = "finding"; + } + + // Updates an organization's settings. + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { + option (google.api.http) = { + patch: "/v1beta1/{organization_settings.name=organizations/*/organizationSettings}" + body: "organization_settings" + }; + option (google.api.method_signature) = "organization_settings"; + } + + // Updates a source. + rpc UpdateSource(UpdateSourceRequest) returns (Source) { + option (google.api.http) = { + patch: "/v1beta1/{source.name=organizations/*/sources/*}" + body: "source" + }; + option (google.api.method_signature) = "source"; + } + + // Updates security marks. + rpc UpdateSecurityMarks(UpdateSecurityMarksRequest) returns (SecurityMarks) { + option (google.api.http) = { + patch: "/v1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}" + body: "security_marks" + additional_bindings { + patch: "/v1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + }; + option (google.api.method_signature) = "security_marks"; + } +} + +// Request message for creating a finding. +message CreateFindingRequest { + // Required. Resource name of the new finding's parent. Its format should be + // "organizations/[organization_id]/sources/[source_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Required. Unique identifier provided by the client within the parent scope. + // It must be alphanumeric and less than or equal to 32 characters and + // greater than 0 characters in length. + string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Finding being created. The name and security_marks will be ignored as + // they are both output only fields on this resource. + Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for creating a source. +message CreateSourceRequest { + // Required. Resource name of the new source's parent. Its format should be + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Required. The Source being created, only the display_name and description will be + // used. All other fields will be ignored. + Source source = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for getting organization settings. +message GetOrganizationSettingsRequest { + // Required. Name of the organization to get organization settings for. Its format is + // "organizations/[organization_id]/organizationSettings". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + } + ]; +} + +// Request message for getting a source. +message GetSourceRequest { + // Required. Relative resource name of the source. Its format is + // "organizations/[organization_id]/source/[source_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; +} + +// Request message for grouping by assets. +message GroupAssetsRequest { + // Required. Name of the organization to groupBy. Its format is + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are not supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `resource_properties.size = 100` is a valid filter string. + string filter = 2; + + // Required. Expression that defines what assets fields to use for grouping. The string + // value should follow SQL syntax: comma separated list of fields. For + // example: + // "security_center_properties.resource_project,security_center_properties.project". + // + // The following fields are supported when compare_duration is not set: + // + // * security_center_properties.resource_project + // * security_center_properties.resource_type + // * security_center_properties.resource_parent + // + // The following fields are supported when compare_duration is set: + // + // * security_center_properties.resource_type + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; + + // When compare_duration is set, the Asset's "state" property is updated to + // indicate whether the asset was added, removed, or remained present during + // the compare_duration period of time that precedes the read_time. This is + // the time between (read_time - compare_duration) and read_time. + // + // The state value is derived based on the presence of the asset at the two + // points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present before + // compare_duration, but present at reference_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at reference_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and reference_time. + // + // This field is ignored if `state` is not a field in `group_by`. + google.protobuf.Duration compare_duration = 4; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 5; + + // The value returned by the last `GroupAssetsResponse`; indicates + // that this is a continuation of a prior `GroupAssets` call, and that the + // system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for grouping by assets. +message GroupAssetsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; +} + +// Request message for grouping by findings. +message GroupFindingsRequest { + // Required. Name of the source to groupBy. Its format is + // "organizations/[organization_id]/sources/[source_id]". To groupBy across + // all sources provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are not supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `source_properties.size = 100` is a valid filter string. + string filter = 2; + + // Required. Expression that defines what assets fields to use for grouping (including + // `state`). The string value should follow SQL syntax: comma separated list + // of fields. For example: + // "parent,resource_name". + // + // The following fields are supported: + // + // * resource_name + // * category + // * state + // * parent + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // The value returned by the last `GroupFindingsResponse`; indicates + // that this is a continuation of a prior `GroupFindings` call, and + // that the system should return the next page of data. + string page_token = 5; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 6; +} + +// Response message for group by findings. +message GroupFindingsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; +} + +// Result containing the properties and count of a groupBy request. +message GroupResult { + // Properties matching the groupBy fields in the request. + map properties = 1; + + // Total count of resources for the given properties. + int64 count = 2; +} + +// Request message for listing sources. +message ListSourcesRequest { + // Required. Resource name of the parent of sources to list. Its format should be + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // The value returned by the last `ListSourcesResponse`; indicates + // that this is a continuation of a prior `ListSources` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 7; +} + +// Response message for listing sources. +message ListSourcesResponse { + // Sources belonging to the requested parent. + repeated Source sources = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + +// Request message for listing assets. +message ListAssetsRequest { + // Required. Name of the organization assets should belong to. Its format is + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are not supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `resource_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,resource_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,resource_properties.a_property" and " + // name desc , resource_properties.a_property " are equivalent. + string order_by = 3; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListAssetResult's "state" attribute is + // updated to indicate whether the asset was added, removed, or remained + // present during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - + // compare_duration) and read_time. + // + // The state value is derived based on the presence of the asset at the two + // points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present before + // compare_duration, but present at read_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at read_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and read_time. + // + // If compare_duration is not specified, then the only possible state is + // "UNUSED", which indicates that the asset is present at read_time. + google.protobuf.Duration compare_duration = 5; + + // Optional. A field mask to specify the ListAssetsResult fields to be listed in the + // response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7 [(google.api.field_behavior) = OPTIONAL]; + + // The value returned by the last `ListAssetsResponse`; indicates + // that this is a continuation of a prior `ListAssets` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing assets. +message ListAssetsResponse { + // Result containing the Asset and its State. + message ListAssetsResult { + // State of the asset. + // + // When querying across two points in time this describes + // the change between the two points: ADDED, REMOVED, or ACTIVE. + // If there was no compare_duration supplied in the request the state should + // be: UNUSED + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // Request did not specify use of this field in the result. + UNUSED = 1; + + // Asset was added between the points in time. + ADDED = 2; + + // Asset was removed between the points in time. + REMOVED = 3; + + // Asset was active at both point(s) in time. + ACTIVE = 4; + } + + // Asset matching the search request. + Asset asset = 1; + + // State of the asset. + State state = 2; + } + + // Assets matching the list request. + repeated ListAssetsResult list_assets_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of assets matching the query. + int32 total_size = 4; +} + +// Request message for listing findings. +message ListFindingsRequest { + // Required. Name of the source the findings belong to. Its format is + // "organizations/[organization_id]/sources/[source_id]". To list across all + // sources provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are not supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `source_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,source_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,source_properties.a_property" and " + // name desc , source_properties.a_property " are equivalent. + string order_by = 3; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // Optional. A field mask to specify the Finding fields to be listed in the response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 5 [(google.api.field_behavior) = OPTIONAL]; + + // The value returned by the last `ListFindingsResponse`; indicates + // that this is a continuation of a prior `ListFindings` call, and + // that the system should return the next page of data. + string page_token = 6; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 7; +} + +// Response message for listing findings. +message ListFindingsResponse { + // Findings matching the list request. + repeated Finding findings = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of findings matching the query. + int32 total_size = 4; +} + +// Request message for updating a finding's state. +message SetFindingStateRequest { + // Required. The relative resource name of the finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Finding" + } + ]; + + // Required. The desired State of the finding. + Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The time at which the updated state takes effect. + google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for running asset discovery for an organization. +message RunAssetDiscoveryRequest { + // Required. Name of the organization to run asset discovery for. Its format is + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; +} + +// Request message for updating or creating a finding. +message UpdateFindingRequest { + // Required. The finding resource to update or create if it does not already exist. + // parent, security_marks, and update_time will be ignored. + // + // In the case of creation, the finding id portion of the name must + // alphanumeric and less than or equal to 32 characters and greater than 0 + // characters in length. + Finding finding = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the finding resource. This field should + // not be specified when creating a finding. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating an organization's settings. +message UpdateOrganizationSettingsRequest { + // Required. The organization settings resource to update. + OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the settings resource. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a source. +message UpdateSourceRequest { + // Required. The source resource to update. + Source source = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the source resource. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a SecurityMarks resource. +message UpdateSecurityMarksRequest { + // Required. The security marks resource to update. + SecurityMarks security_marks = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the security marks resource. + google.protobuf.FieldMask update_mask = 2; + + // The time at which the updated SecurityMarks take effect. + google.protobuf.Timestamp start_time = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto new file mode 100644 index 00000000000..a4a49749ed3 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1beta1/source.proto @@ -0,0 +1,55 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + +// Security Command Center finding source. A finding source +// is an entity or a mechanism that can produce a finding. A source is like a +// container of findings that come from the same scanner, logger, monitor, etc. +message Source { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Source" + pattern: "organizations/{organization}/sources/{source}" + }; + + // The relative resource name of this source. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}" + string name = 1; + + // The source's display name. + // A source's display name must be unique amongst its siblings, for example, + // two sources with the same parent can't share the same display name. + // The display name must have a length between 1 and 64 characters + // (inclusive). + string display_name = 2; + + // The description of the source (max of 1024 characters). + // Example: + // "Web Security Scanner is a web security scanner for common + // vulnerabilities in App Engine applications. It can automatically + // scan and detect four common vulnerabilities, including cross-site-scripting + // (XSS), Flash injection, mixed content (HTTP in HTTPS), and + // outdated/insecure libraries." + string description = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto new file mode 100644 index 00000000000..45fdcbf5a5a --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto @@ -0,0 +1,134 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1p1beta1/folder.proto"; +import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// Security Command Center representation of a Google Cloud +// resource. +// +// The Asset is a Security Command Center resource that captures information +// about a single Google Cloud resource. All modifications to an Asset are only +// within the context of Security Command Center and don't affect the referenced +// Google Cloud resource. +message Asset { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Asset" + pattern: "organizations/{organization}/assets/{asset}" + pattern: "folders/{folder}/assets/{asset}" + pattern: "projects/{project}/assets/{asset}" + }; + + // Security Command Center managed properties. These properties are managed by + // Security Command Center and cannot be modified by the user. + message SecurityCenterProperties { + // The full resource name of the Google Cloud resource this asset + // represents. This field is immutable after create time. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_name = 1; + + // The type of the Google Cloud resource. Examples include: APPLICATION, + // PROJECT, and ORGANIZATION. This is a case insensitive field defined by + // Security Command Center and/or the producer of the resource and is + // immutable after create time. + string resource_type = 2; + + // The full resource name of the immediate parent of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_parent = 3; + + // The full resource name of the project the resource belongs to. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_project = 4; + + // Owners of the Google Cloud resource. + repeated string resource_owners = 5; + + // The user defined display name for this resource. + string resource_display_name = 6; + + // The user defined display name for the parent of this resource. + string resource_parent_display_name = 7; + + // The user defined display name for the project of this resource. + string resource_project_display_name = 8; + + // Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is the + // folder directly under the Organization. + repeated Folder folders = 10; + } + + // Cloud IAM Policy information associated with the Google Cloud resource + // described by the Security Command Center asset. This information is managed + // and defined by the Google Cloud resource and cannot be modified by the + // user. + message IamPolicy { + // The JSON representation of the Policy associated with the asset. + // See https://cloud.google.com/iam/docs/reference/rest/v1/Policy for + // format details. + string policy_blob = 1; + } + + // The relative resource name of this asset. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/assets/{asset_id}". + string name = 1; + + // Security Command Center managed properties. These properties are managed by + // Security Command Center and cannot be modified by the user. + SecurityCenterProperties security_center_properties = 2; + + // Resource managed properties. These properties are managed and defined by + // the Google Cloud resource and cannot be modified by the user. + map resource_properties = 7; + + // User specified security marks. These marks are entirely managed by the user + // and come from the SecurityMarks resource that belongs to the asset. + SecurityMarks security_marks = 8; + + // The time at which the asset was created in Security Command Center. + google.protobuf.Timestamp create_time = 9; + + // The time at which the asset was last updated or added in Cloud SCC. + google.protobuf.Timestamp update_time = 10; + + // Cloud IAM Policy information associated with the Google Cloud resource + // described by the Security Command Center asset. This information is managed + // and defined by the Google Cloud resource and cannot be modified by the + // user. + IamPolicy iam_policy = 11; + + // The canonical name of the resource. It's either + // "organizations/{organization_id}/assets/{asset_id}", + // "folders/{folder_id}/assets/{asset_id}" or + // "projects/{project_number}/assets/{asset_id}", depending on the closest CRM + // ancestor of the resource. + string canonical_name = 13; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto new file mode 100644 index 00000000000..5edd3d86296 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/finding.proto @@ -0,0 +1,145 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// Security Command Center finding. +// +// A finding is a record of assessment data (security, risk, health or privacy) +// ingested into Security Command Center for presentation, notification, +// analysis, policy testing, and enforcement. For example, an XSS vulnerability +// in an App Engine application is a finding. +message Finding { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Finding" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}" + pattern: "folders/{folder}/sources/{source}/findings/{finding}" + pattern: "projects/{project}/sources/{source}/findings/{finding}" + }; + + // The state of the finding. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // The finding requires attention and has not been addressed yet. + ACTIVE = 1; + + // The finding has been fixed, triaged as a non-issue or otherwise addressed + // and is no longer active. + INACTIVE = 2; + } + + // The severity of the finding. This field is managed by the source that + // writes the finding. + 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; + } + + // The relative resource name of this finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" + string name = 1; + + // The relative resource name of the source the finding belongs to. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // This field is immutable after creation time. + // For example: + // "organizations/{organization_id}/sources/{source_id}" + string parent = 2; + + // For findings on Google Cloud resources, the full resource + // name of the Google Cloud resource this finding is for. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + // When the finding is for a non-Google Cloud resource, the resourceName can + // be a customer or partner defined string. This field is immutable after + // creation time. + string resource_name = 3; + + // The state of the finding. + State state = 4; + + // The additional taxonomy group within findings from a given source. + // This field is immutable after creation time. + // Example: "XSS_FLASH_INJECTION" + string category = 5; + + // The URI that, if available, points to a web page outside of Security + // Command Center where additional information about the finding can be found. + // This field is guaranteed to be either empty or a well formed URL. + string external_uri = 6; + + // Source specific properties. These properties are managed by the source + // that writes the finding. The key names in the source_properties map must be + // between 1 and 255 characters, and must start with a letter and contain + // alphanumeric characters or underscores only. + map source_properties = 7; + + // Output only. User specified security marks. These marks are entirely + // managed by the user and come from the SecurityMarks resource that belongs + // to the finding. + SecurityMarks security_marks = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The time at which the event took place, or when an update to the finding + // occurred. For example, if the finding represents an open firewall it would + // capture the time the detector believes the firewall became open. The + // accuracy is determined by the detector. If the finding were to be resolved + // afterward, this time would reflect when the finding was resolved. Must not + // be set to a value greater than the current timestamp. + google.protobuf.Timestamp event_time = 9; + + // The time at which the finding was created in Security Command Center. + google.protobuf.Timestamp create_time = 10; + + // The severity of the finding. This field is managed by the source that + // writes the finding. + Severity severity = 13; + + // The canonical name of the finding. It's either + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + // "folders/{folder_id}/sources/{source_id}/findings/{finding_id}" or + // "projects/{project_number}/sources/{source_id}/findings/{finding_id}", + // depending on the closest CRM ancestor of the resource associated with the + // finding. + string canonical_name = 14; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto new file mode 100644 index 00000000000..28a587163c1 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/folder.proto @@ -0,0 +1,37 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "FolderProto"; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1Beta1"; + +// Message that contains the resource name and display name of a folder +// resource. +message Folder { + // Full resource name of this folder. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_folder = 1; + + // The user defined display name for this folder. + string resource_folder_display_name = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto new file mode 100644 index 00000000000..faaab37b102 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto @@ -0,0 +1,107 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Security Command Center notification configs. +// +// A notification config is a Security Command Center resource that contains the +// configuration to send notifications for create/update events of findings, +// assets and etc. +message NotificationConfig { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/NotificationConfig" + pattern: "organizations/{organization}/notificationConfigs/{notification_config}" + }; + + // The config for streaming-based notifications, which send each event as soon + // as it is detected. + message StreamingConfig { + // Expression that defines the filter to apply across create/update events + // of assets or findings as specified by the event type. The expression is a + // list of zero or more restrictions combined via logical operators `AND` + // and `OR`. Parentheses are supported, and `OR` has higher precedence than + // `AND`. + // + // Restrictions have the form ` ` and may have a + // `-` character in front of them to indicate negation. The fields map to + // those defined in the corresponding resource. + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + string filter = 1; + } + + // The type of events. + enum EventType { + // Unspecified event type. + EVENT_TYPE_UNSPECIFIED = 0; + + // Events for findings. + FINDING = 1; + } + + // The relative resource name of this notification config. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/notificationConfigs/notify_public_bucket". + string name = 1; + + // The description of the notification config (max of 1024 characters). + string description = 2; + + // The type of events the config is for, e.g. FINDING. + EventType event_type = 3; + + // The Pub/Sub topic to send notifications to. Its format is + // "projects/[project_id]/topics/[topic]". + string pubsub_topic = 4 [(google.api.resource_reference) = { + type: "pubsub.googleapis.com/Topic" + }]; + + // Output only. The service account that needs "pubsub.topics.publish" + // permission to publish to the Pub/Sub topic. + string service_account = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The config for triggering notifications. + oneof notify_config { + // The config for triggering streaming-based notifications. + StreamingConfig streaming_config = 6; + } +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto new file mode 100644 index 00000000000..78a3e781f12 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto @@ -0,0 +1,43 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/cloud/securitycenter/v1p1beta1/finding.proto"; +import "google/cloud/securitycenter/v1p1beta1/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// Security Command Center's Notification +message NotificationMessage { + // Name of the notification config that generated current notification. + string notification_config_name = 1; + + // Notification Event. + oneof event { + // If it's a Finding based notification config, this field will be + // populated. + Finding finding = 2; + } + + // The Cloud resource tied to the notification. + Resource resource = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto new file mode 100644 index 00000000000..b80f046d6b8 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto @@ -0,0 +1,85 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// User specified settings that are attached to the Security Command +// Center organization. +message OrganizationSettings { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + pattern: "organizations/{organization}/organizationSettings" + }; + + // The configuration used for Asset Discovery runs. + message AssetDiscoveryConfig { + // The mode of inclusion when running Asset Discovery. + // Asset discovery can be limited by explicitly identifying projects to be + // included or excluded. If INCLUDE_ONLY is set, then only those projects + // within the organization and their children are discovered during asset + // discovery. If EXCLUDE is set, then projects that don't match those + // projects are discovered during asset discovery. If neither are set, then + // all projects within the organization are discovered during asset + // discovery. + enum InclusionMode { + // Unspecified. Setting the mode with this value will disable + // inclusion/exclusion filtering for Asset Discovery. + INCLUSION_MODE_UNSPECIFIED = 0; + + // Asset Discovery will capture only the resources within the projects + // specified. All other resources will be ignored. + INCLUDE_ONLY = 1; + + // Asset Discovery will ignore all resources under the projects specified. + // All other resources will be retrieved. + EXCLUDE = 2; + } + + // The project ids to use for filtering asset discovery. + repeated string project_ids = 1; + + // The mode to use for filtering asset discovery. + InclusionMode inclusion_mode = 2; + + // The folder ids to use for filtering asset discovery. + // It consists of only digits, e.g., 756619654966. + repeated string folder_ids = 3; + } + + // The relative resource name of the settings. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/organizationSettings". + string name = 1; + + // A flag that indicates if Asset Discovery should be enabled. If the flag is + // set to `true`, then discovery of assets will occur. If it is set to `false, + // all historical assets will remain, but discovery of future assets will not + // occur. + bool enable_asset_discovery = 2; + + // The configuration used for Asset Discovery runs. + AssetDiscoveryConfig asset_discovery_config = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto new file mode 100644 index 00000000000..3b2d2d437e8 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/resource.proto @@ -0,0 +1,52 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/securitycenter/v1p1beta1/folder.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "ResourceProto"; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// Information related to the Google Cloud resource. +message Resource { + // The full resource name of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string name = 1; + + // The full resource name of project that the resource belongs to. + string project = 2; + + // The human readable name of project that the resource belongs to. + string project_display_name = 3; + + // The full resource name of resource's parent. + string parent = 4; + + // The human readable name of resource's parent. + string parent_display_name = 5; + + // Output only. Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is the + // folder directly under the Organization. + repeated Folder folders = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto new file mode 100644 index 00000000000..835e33fbdf1 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto @@ -0,0 +1,51 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// Response of asset discovery run +message RunAssetDiscoveryResponse { + // The state of an asset discovery run. + enum State { + // Asset discovery run state was unspecified. + STATE_UNSPECIFIED = 0; + + // Asset discovery run completed successfully. + COMPLETED = 1; + + // Asset discovery run was cancelled with tasks still pending, as another + // run for the same organization was started with a higher priority. + SUPERSEDED = 2; + + // Asset discovery run was killed and terminated. + TERMINATED = 3; + } + + // The state of an asset discovery run. + State state = 1; + + // The duration between asset discovery run start and end + google.protobuf.Duration duration = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto new file mode 100644 index 00000000000..2245605b3e4 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto @@ -0,0 +1,69 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// User specified security marks that are attached to the parent Security +// Command Center resource. Security marks are scoped within a Security Command +// Center organization -- they can be modified and viewed by all users who have +// proper permissions on the organization. +message SecurityMarks { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/SecurityMarks" + pattern: "organizations/{organization}/assets/{asset}/securityMarks" + pattern: "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + pattern: "folders/{folder}/assets/{asset}/securityMarks" + pattern: "projects/{project}/assets/{asset}/securityMarks" + pattern: "folders/{folder}/sources/{source}/findings/{finding}/securityMarks" + pattern: "projects/{project}/sources/{source}/findings/{finding}/securityMarks" + }; + + // The relative resource name of the SecurityMarks. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Examples: + // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". + string name = 1; + + // Mutable user specified security marks belonging to the parent resource. + // Constraints are as follows: + // + // * Keys and values are treated as case insensitive + // * Keys must be between 1 - 256 characters (inclusive) + // * Keys must be letters, numbers, underscores, or dashes + // * Values have leading and trailing whitespace trimmed, remaining + // characters must be between 1 - 4096 characters (inclusive) + map marks = 2; + + // The canonical name of the marks. + // Examples: + // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + // "folders/{folder_id}/assets/{asset_id}/securityMarks" + // "projects/{project_number}/assets/{asset_id}/securityMarks" + // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks" + // "folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks" + // "projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks" + string canonical_name = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto new file mode 100644 index 00000000000..958e69714cf --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto @@ -0,0 +1,1351 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import public "google/cloud/securitycenter/v1p1beta1/notification_message.proto"; +import public "google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/securitycenter/v1p1beta1/asset.proto"; +import "google/cloud/securitycenter/v1p1beta1/finding.proto"; +import "google/cloud/securitycenter/v1p1beta1/folder.proto"; +import "google/cloud/securitycenter/v1p1beta1/notification_config.proto"; +import "google/cloud/securitycenter/v1p1beta1/organization_settings.proto"; +import "google/cloud/securitycenter/v1p1beta1/security_marks.proto"; +import "google/cloud/securitycenter/v1p1beta1/source.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// V1p1Beta1 APIs for Security Center service. +service SecurityCenter { + option (google.api.default_host) = "securitycenter.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a source. + rpc CreateSource(CreateSourceRequest) returns (Source) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*}/sources" + body: "source" + }; + option (google.api.method_signature) = "parent,source"; + } + + // Creates a finding. The corresponding source must exist for finding + // creation to succeed. + rpc CreateFinding(CreateFindingRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*/sources/*}/findings" + body: "finding" + }; + option (google.api.method_signature) = "parent,finding_id,finding"; + option (google.api.method_signature) = "parent,finding,finding_id"; + } + + // Creates a notification config. + rpc CreateNotificationConfig(CreateNotificationConfigRequest) returns (NotificationConfig) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*}/notificationConfigs" + body: "notification_config" + }; + option (google.api.method_signature) = "parent,config_id,notification_config"; + option (google.api.method_signature) = "parent,notification_config"; + } + + // Deletes a notification config. + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p1beta1/{name=organizations/*/notificationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the access control policy on the specified Source. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1p1beta1/{resource=organizations/*/sources/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Gets a notification config. + rpc GetNotificationConfig(GetNotificationConfigRequest) returns (NotificationConfig) { + option (google.api.http) = { + get: "/v1p1beta1/{name=organizations/*/notificationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the settings for an organization. + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { + option (google.api.http) = { + get: "/v1p1beta1/{name=organizations/*/organizationSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a source. + rpc GetSource(GetSourceRequest) returns (Source) { + option (google.api.http) = { + get: "/v1p1beta1/{name=organizations/*/sources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Filters an organization's assets and groups them by their specified + // properties. + rpc GroupAssets(GroupAssetsRequest) returns (GroupAssetsResponse) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*}/assets:group" + body: "*" + additional_bindings { + post: "/v1p1beta1/{parent=folders/*}/assets:group" + body: "*" + } + additional_bindings { + post: "/v1p1beta1/{parent=projects/*}/assets:group" + body: "*" + } + }; + } + + // Filters an organization or source's findings and groups them by their + // specified properties. + // + // To group across all sources provide a `-` as the source id. + // Example: /v1/organizations/{organization_id}/sources/-/findings, + // /v1/folders/{folder_id}/sources/-/findings, + // /v1/projects/{project_id}/sources/-/findings + rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*/sources/*}/findings:group" + body: "*" + additional_bindings { + post: "/v1p1beta1/{parent=folders/*/sources/*}/findings:group" + body: "*" + } + additional_bindings { + post: "/v1p1beta1/{parent=projects/*/sources/*}/findings:group" + body: "*" + } + }; + option (google.api.method_signature) = "parent,group_by"; + } + + // Lists an organization's assets. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=organizations/*}/assets" + additional_bindings { + get: "/v1p1beta1/{parent=folders/*}/assets" + } + additional_bindings { + get: "/v1p1beta1/{parent=projects/*}/assets" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists an organization or source's findings. + // + // To list across all sources provide a `-` as the source id. + // Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=organizations/*/sources/*}/findings" + additional_bindings { + get: "/v1p1beta1/{parent=folders/*/sources/*}/findings" + } + additional_bindings { + get: "/v1p1beta1/{parent=projects/*/sources/*}/findings" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Lists notification configs. + rpc ListNotificationConfigs(ListNotificationConfigsRequest) returns (ListNotificationConfigsResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=organizations/*}/notificationConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all sources belonging to an organization. + rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=organizations/*}/sources" + additional_bindings { + get: "/v1p1beta1/{parent=folders/*}/sources" + } + additional_bindings { + get: "/v1p1beta1/{parent=projects/*}/sources" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Runs asset discovery. The discovery is tracked with a long-running + // operation. + // + // This API can only be called with limited frequency for an organization. If + // it is called too frequently the caller will receive a TOO_MANY_REQUESTS + // error. + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=organizations/*}/assets:runDiscovery" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse" + metadata_type: "google.protobuf.Empty" + }; + } + + // Updates the state of a finding. + rpc SetFindingState(SetFindingStateRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1p1beta1/{name=organizations/*/sources/*/findings/*}:setState" + body: "*" + additional_bindings { + post: "/v1p1beta1/{name=folders/*/sources/*/findings/*}:setState" + body: "*" + } + additional_bindings { + post: "/v1p1beta1/{name=projects/*/sources/*/findings/*}:setState" + body: "*" + } + }; + option (google.api.method_signature) = "name,state,start_time"; + } + + // Sets the access control policy on the specified Source. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1p1beta1/{resource=organizations/*/sources/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Returns the permissions that a caller has on the specified source. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1p1beta1/{resource=organizations/*/sources/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Creates or updates a finding. The corresponding source must exist for a + // finding creation to succeed. + rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { + option (google.api.http) = { + patch: "/v1p1beta1/{finding.name=organizations/*/sources/*/findings/*}" + body: "finding" + additional_bindings { + patch: "/v1p1beta1/{finding.name=folders/*/sources/*/findings/*}" + body: "finding" + } + additional_bindings { + patch: "/v1p1beta1/{finding.name=projects/*/sources/*/findings/*}" + body: "finding" + } + }; + option (google.api.method_signature) = "finding"; + option (google.api.method_signature) = "finding,update_mask"; + } + + // Updates a notification config. The following update + // fields are allowed: description, pubsub_topic, streaming_config.filter + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) returns (NotificationConfig) { + option (google.api.http) = { + patch: "/v1p1beta1/{notification_config.name=organizations/*/notificationConfigs/*}" + body: "notification_config" + }; + option (google.api.method_signature) = "notification_config"; + option (google.api.method_signature) = "notification_config,update_mask"; + } + + // Updates an organization's settings. + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { + option (google.api.http) = { + patch: "/v1p1beta1/{organization_settings.name=organizations/*/organizationSettings}" + body: "organization_settings" + }; + option (google.api.method_signature) = "organization_settings"; + } + + // Updates a source. + rpc UpdateSource(UpdateSourceRequest) returns (Source) { + option (google.api.http) = { + patch: "/v1p1beta1/{source.name=organizations/*/sources/*}" + body: "source" + }; + option (google.api.method_signature) = "source"; + option (google.api.method_signature) = "source,update_mask"; + } + + // Updates security marks. + rpc UpdateSecurityMarks(UpdateSecurityMarksRequest) returns (SecurityMarks) { + option (google.api.http) = { + patch: "/v1p1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}" + body: "security_marks" + additional_bindings { + patch: "/v1p1beta1/{security_marks.name=folders/*/assets/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1p1beta1/{security_marks.name=projects/*/assets/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1p1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1p1beta1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + additional_bindings { + patch: "/v1p1beta1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + }; + option (google.api.method_signature) = "security_marks"; + option (google.api.method_signature) = "security_marks,update_mask"; + } +} + +// Request message for creating a finding. +message CreateFindingRequest { + // Required. Resource name of the new finding's parent. Its format should be + // "organizations/[organization_id]/sources/[source_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Required. Unique identifier provided by the client within the parent scope. + string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Finding being created. The name and security_marks will be ignored as + // they are both output only fields on this resource. + Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for creating a notification config. +message CreateNotificationConfigRequest { + // Required. Resource name of the new notification config's parent. Its format is + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Required. Unique identifier provided by the client within the parent scope. + // It must be between 1 and 128 characters, and contains alphanumeric + // characters, underscores or hyphens only. + string config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The notification config being created. The name and the service account + // will be ignored as they are both output only fields on this resource. + NotificationConfig notification_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for creating a source. +message CreateSourceRequest { + // Required. Resource name of the new source's parent. Its format should be + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Required. The Source being created, only the display_name and description will be + // used. All other fields will be ignored. + Source source = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for deleting a notification config. +message DeleteNotificationConfigRequest { + // Required. Name of the notification config to delete. Its format is + // "organizations/[organization_id]/notificationConfigs/[config_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + +// Request message for getting a notification config. +message GetNotificationConfigRequest { + // Required. Name of the notification config to get. Its format is + // "organizations/[organization_id]/notificationConfigs/[config_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + +// Request message for getting organization settings. +message GetOrganizationSettingsRequest { + // Required. Name of the organization to get organization settings for. Its format is + // "organizations/[organization_id]/organizationSettings". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/OrganizationSettings" + } + ]; +} + +// Request message for getting a source. +message GetSourceRequest { + // Required. Relative resource name of the source. Its format is + // "organizations/[organization_id]/source/[source_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; +} + +// Request message for grouping by assets. +message GroupAssetsRequest { + // Required. Name of the organization to groupBy. Its format is + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/Asset" + } + ]; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following field and operator combinations are supported: + // + // * name: `=` + // * update_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // `update_time = "2019-06-10T16:07:18-07:00"` + // `update_time = 1560208038000` + // + // * create_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // `create_time = "2019-06-10T16:07:18-07:00"` + // `create_time = 1560208038000` + // + // * iam_policy.policy_blob: `=`, `:` + // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // * security_marks.marks: `=`, `:` + // * security_center_properties.resource_name: `=`, `:` + // * security_center_properties.resource_name_display_name: `=`, `:` + // * security_center_properties.resource_type: `=`, `:` + // * security_center_properties.resource_parent: `=`, `:` + // * security_center_properties.resource_parent_display_name: `=`, `:` + // * security_center_properties.resource_project: `=`, `:` + // * security_center_properties.resource_project_display_name: `=`, `:` + // * security_center_properties.resource_owners: `=`, `:` + // + // For example, `resource_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `resource_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-resource_properties.my_property : ""` + string filter = 2; + + // Required. Expression that defines what assets fields to use for grouping. The string + // value should follow SQL syntax: comma separated list of fields. For + // example: + // "security_center_properties.resource_project,security_center_properties.project". + // + // The following fields are supported when compare_duration is not set: + // + // * security_center_properties.resource_project + // * security_center_properties.resource_project_display_name + // * security_center_properties.resource_type + // * security_center_properties.resource_parent + // * security_center_properties.resource_parent_display_name + // + // The following fields are supported when compare_duration is set: + // + // * security_center_properties.resource_type + // * security_center_properties.resource_project_display_name + // * security_center_properties.resource_parent_display_name + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; + + // When compare_duration is set, the GroupResult's "state_change" property is + // updated to indicate whether the asset was added, removed, or remained + // present during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state change value is derived based on the presence of the asset at the + // two points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present at the start of + // compare_duration, but present at reference_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at reference_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and reference_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all assets present at + // read_time. + // + // If this field is set then `state_change` must be a specified field in + // `group_by`. + google.protobuf.Duration compare_duration = 4; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 5; + + // The value returned by the last `GroupAssetsResponse`; indicates + // that this is a continuation of a prior `GroupAssets` call, and that the + // system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for grouping by assets. +message GroupAssetsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of results matching the query. + int32 total_size = 4; +} + +// Request message for grouping by findings. +message GroupFindingsRequest { + // Required. Name of the source to groupBy. Its format is + // "organizations/[organization_id]/sources/[source_id]", + // folders/[folder_id]/sources/[source_id], or + // projects/[project_id]/sources/[source_id]. To groupBy across all sources + // provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + // or projects/{project_id}/sources/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following field and operator combinations are supported: + // + // * name: `=` + // * parent: `=`, `:` + // * resource_name: `=`, `:` + // * state: `=`, `:` + // * category: `=`, `:` + // * external_uri: `=`, `:` + // * event_time: `=`, `>`, `<`, `>=`, `<=` + // * severity: `=`, `:` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // `event_time = "2019-06-10T16:07:18-07:00"` + // `event_time = 1560208038000` + // + // * security_marks.marks: `=`, `:` + // * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // + // For example, `source_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `source_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-source_properties.my_property : ""` + string filter = 2; + + // Required. Expression that defines what assets fields to use for grouping (including + // `state_change`). The string value should follow SQL syntax: comma separated + // list of fields. For example: "parent,resource_name". + // + // The following fields are supported: + // + // * resource_name + // * category + // * state + // * parent + // * severity + // + // The following fields are supported when compare_duration is set: + // + // * state_change + string group_by = 3 [(google.api.field_behavior) = REQUIRED]; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the GroupResult's "state_change" attribute is + // updated to indicate whether the finding had its state changed, the + // finding's state remained unchanged, or if the finding was added during the + // compare_duration period of time that precedes the read_time. This is the + // time between (read_time - compare_duration) and read_time. + // + // The state_change value is derived based on the presence and state of the + // finding at the two points in time. Intermediate state changes between the + // two times don't affect the result. For example, the results aren't affected + // if the finding is made inactive and then active again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "CHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration, but changed its + // state at read_time. + // * "UNCHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration and did not change + // state at read_time. + // * "ADDED": indicates that the finding did not match the given filter or + // was not present at the start of compare_duration, but was + // present at read_time. + // * "REMOVED": indicates that the finding was present and matched the + // filter at the start of compare_duration, but did not match + // the filter at read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all findings present + // at read_time. + // + // If this field is set then `state_change` must be a specified field in + // `group_by`. + google.protobuf.Duration compare_duration = 5; + + // The value returned by the last `GroupFindingsResponse`; indicates + // that this is a continuation of a prior `GroupFindings` call, and + // that the system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for group by findings. +message GroupFindingsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of results matching the query. + int32 total_size = 4; +} + +// Result containing the properties and count of a groupBy request. +message GroupResult { + // Properties matching the groupBy fields in the request. + map properties = 1; + + // Total count of resources for the given properties. + int64 count = 2; +} + +// Request message for listing notification configs. +message ListNotificationConfigsRequest { + // Required. Name of the organization to list notification configs. + // Its format is "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // The value returned by the last `ListNotificationConfigsResponse`; indicates + // that this is a continuation of a prior `ListNotificationConfigs` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 3; +} + +// Response message for listing notification configs. +message ListNotificationConfigsResponse { + // Notification configs belonging to the requested parent. + repeated NotificationConfig notification_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + +// Request message for listing sources. +message ListSourcesRequest { + // Required. Resource name of the parent of sources to list. Its format should be + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/Source" + } + ]; + + // The value returned by the last `ListSourcesResponse`; indicates + // that this is a continuation of a prior `ListSources` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 7; +} + +// Response message for listing sources. +message ListSourcesResponse { + // Sources belonging to the requested parent. + repeated Source sources = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + +// Request message for listing assets. +message ListAssetsRequest { + // Required. Name of the organization assets should belong to. Its format is + // "organizations/[organization_id], folders/[folder_id], or + // projects/[project_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securitycenter.googleapis.com/Asset" + } + ]; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following are the allowed field and operator combinations: + // + // * name: `=` + // * update_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // `update_time = "2019-06-10T16:07:18-07:00"` + // `update_time = 1560208038000` + // + // * create_time: `=`, `>`, `<`, `>=`, `<=` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // `create_time = "2019-06-10T16:07:18-07:00"` + // `create_time = 1560208038000` + // + // * iam_policy.policy_blob: `=`, `:` + // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // * security_marks.marks: `=`, `:` + // * security_center_properties.resource_name: `=`, `:` + // * security_center_properties.resource_display_name: `=`, `:` + // * security_center_properties.resource_type: `=`, `:` + // * security_center_properties.resource_parent: `=`, `:` + // * security_center_properties.resource_parent_display_name: `=`, `:` + // * security_center_properties.resource_project: `=`, `:` + // * security_center_properties.resource_project_display_name: `=`, `:` + // * security_center_properties.resource_owners: `=`, `:` + // + // For example, `resource_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `resource_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-resource_properties.my_property : ""` + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,resource_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,resource_properties.a_property" and " + // name desc , resource_properties.a_property " are equivalent. + // + // The following fields are supported: + // name + // update_time + // resource_properties + // security_marks.marks + // security_center_properties.resource_name + // security_center_properties.resource_display_name + // security_center_properties.resource_parent + // security_center_properties.resource_parent_display_name + // security_center_properties.resource_project + // security_center_properties.resource_project_display_name + // security_center_properties.resource_type + string order_by = 3; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListAssetsResult's "state_change" + // attribute is updated to indicate whether the asset was added, removed, or + // remained present during the compare_duration period of time that precedes + // the read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state_change value is derived based on the presence of the asset at the + // two points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present at the start of + // compare_duration, but present at read_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at read_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all assets present at + // read_time. + google.protobuf.Duration compare_duration = 5; + + // A field mask to specify the ListAssetsResult fields to be listed in the + // response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7; + + // The value returned by the last `ListAssetsResponse`; indicates + // that this is a continuation of a prior `ListAssets` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing assets. +message ListAssetsResponse { + // Result containing the Asset and its State. + message ListAssetsResult { + // The change in state of the asset. + // + // When querying across two points in time this describes + // the change between the two points: ADDED, REMOVED, or ACTIVE. + // If there was no compare_duration supplied in the request the state change + // will be: UNUSED + enum StateChange { + // State change is unused, this is the canonical default for this enum. + UNUSED = 0; + + // Asset was added between the points in time. + ADDED = 1; + + // Asset was removed between the points in time. + REMOVED = 2; + + // Asset was present at both point(s) in time. + ACTIVE = 3; + } + + // Asset matching the search request. + Asset asset = 1; + + // State change of the asset between the points in time. + StateChange state_change = 2; + } + + // Assets matching the list request. + repeated ListAssetsResult list_assets_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of assets matching the query. + int32 total_size = 4; +} + +// Request message for listing findings. +message ListFindingsRequest { + // Required. Name of the source the findings belong to. Its format is + // "organizations/[organization_id]/sources/[source_id], + // folders/[folder_id]/sources/[source_id], or + // projects/[project_id]/sources/[source_id]". To list across all sources + // provide a source_id of `-`. For example: + // organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + // projects/{projects_id}/sources/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Source" + } + ]; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // The following field and operator combinations are supported: + // + // * name: `=` + // * parent: `=`, `:` + // * resource_name: `=`, `:` + // * state: `=`, `:` + // * category: `=`, `:` + // * external_uri: `=`, `:` + // * event_time: `=`, `>`, `<`, `>=`, `<=` + // * severity: `=`, `:` + // + // Usage: This should be milliseconds since epoch or an RFC3339 string. + // Examples: + // `event_time = "2019-06-10T16:07:18-07:00"` + // `event_time = 1560208038000` + // + // security_marks.marks: `=`, `:` + // source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + // + // For example, `source_properties.size = 100` is a valid filter string. + // + // Use a partial match on the empty string to filter based on a property + // existing: `source_properties.my_property : ""` + // + // Use a negated partial match on the empty string to filter based on a + // property not existing: `-source_properties.my_property : ""` + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,source_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,source_properties.a_property" and " + // name desc , source_properties.a_property " are equivalent. + // + // The following fields are supported: + // name + // parent + // state + // category + // resource_name + // event_time + // source_properties + // security_marks.marks + string order_by = 3; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListFindingsResult's "state_change" + // attribute is updated to indicate whether the finding had its state changed, + // the finding's state remained unchanged, or if the finding was added in any + // state during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state_change value is derived based on the presence and state of the + // finding at the two points in time. Intermediate state changes between the + // two times don't affect the result. For example, the results aren't affected + // if the finding is made inactive and then active again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "CHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration, but changed its + // state at read_time. + // * "UNCHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration and did not change + // state at read_time. + // * "ADDED": indicates that the finding did not match the given filter or + // was not present at the start of compare_duration, but was + // present at read_time. + // * "REMOVED": indicates that the finding was present and matched the + // filter at the start of compare_duration, but did not match + // the filter at read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all findings present at + // read_time. + google.protobuf.Duration compare_duration = 5; + + // A field mask to specify the Finding fields to be listed in the response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7; + + // The value returned by the last `ListFindingsResponse`; indicates + // that this is a continuation of a prior `ListFindings` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing findings. +message ListFindingsResponse { + // Result containing the Finding and its StateChange. + message ListFindingsResult { + // Information related to the Google Cloud resource that is + // associated with this finding. + message Resource { + // The full resource name of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string name = 1; + + // The full resource name of project that the resource belongs to. + string project_name = 2; + + // The human readable name of project that the resource belongs to. + string project_display_name = 3; + + // The full resource name of resource's parent. + string parent_name = 4; + + // The human readable name of resource's parent. + string parent_display_name = 5; + + // Contains a Folder message for each folder in the assets ancestry. + // The first folder is the deepest nested folder, and the last folder is + // the folder directly under the Organization. + repeated Folder folders = 10; + } + + // The change in state of the finding. + // + // When querying across two points in time this describes + // the change in the finding between the two points: CHANGED, UNCHANGED, + // ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that + // the finding at timestamp does not match the filter specified, but it did + // at timestamp - compare_duration. If there was no compare_duration + // supplied in the request the state change will be: UNUSED + enum StateChange { + // State change is unused, this is the canonical default for this enum. + UNUSED = 0; + + // The finding has changed state in some way between the points in time + // and existed at both points. + CHANGED = 1; + + // The finding has not changed state between the points in time and + // existed at both points. + UNCHANGED = 2; + + // The finding was created between the points in time. + ADDED = 3; + + // The finding at timestamp does not match the filter specified, but it + // did at timestamp - compare_duration. + REMOVED = 4; + } + + // Finding matching the search request. + Finding finding = 1; + + // State change of the finding between the points in time. + StateChange state_change = 2; + + // Output only. Resource that is associated with this finding. + Resource resource = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Findings matching the list request. + repeated ListFindingsResult list_findings_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of findings matching the query. + int32 total_size = 4; +} + +// Request message for updating a finding's state. +message SetFindingStateRequest { + // Required. The relative resource name of the finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/Finding" + } + ]; + + // Required. The desired State of the finding. + Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The time at which the updated state takes effect. + google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for running asset discovery for an organization. +message RunAssetDiscoveryRequest { + // Required. Name of the organization to run asset discovery for. Its format is + // "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; +} + +// Request message for updating or creating a finding. +message UpdateFindingRequest { + // Required. The finding resource to update or create if it does not already exist. + // parent, security_marks, and update_time will be ignored. + // + // In the case of creation, the finding id portion of the name must be + // alphanumeric and less than or equal to 32 characters and greater than 0 + // characters in length. + Finding finding = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the finding resource. This field should + // not be specified when creating a finding. + // + // When updating a finding, an empty mask is treated as updating all mutable + // fields and replacing source_properties. Individual source_properties can + // be added/updated by using "source_properties." in the field + // mask. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a notification config. +message UpdateNotificationConfigRequest { + // Required. The notification config to update. + NotificationConfig notification_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the notification config. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating an organization's settings. +message UpdateOrganizationSettingsRequest { + // Required. The organization settings resource to update. + OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the settings resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a source. +message UpdateSourceRequest { + // Required. The source resource to update. + Source source = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the source resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a SecurityMarks resource. +message UpdateSecurityMarksRequest { + // Required. The security marks resource to update. + SecurityMarks security_marks = 1 [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the security marks resource. + // + // The field mask must not contain duplicate fields. + // If empty or set to "marks", all marks will be replaced. Individual + // marks can be updated using "marks.". + google.protobuf.FieldMask update_mask = 2; + + // The time at which the updated SecurityMarks take effect. + // If not set uses current server time. Updates will be applied to the + // SecurityMarks that are active immediately preceding this time. + google.protobuf.Timestamp start_time = 3; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto new file mode 100644 index 00000000000..e2a55659556 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/source.proto @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1p1beta1; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1p1beta1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; + +// Security Command Center finding source. A finding source +// is an entity or a mechanism that can produce a finding. A source is like a +// container of findings that come from the same scanner, logger, monitor, etc. +message Source { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/Source" + pattern: "organizations/{organization}/sources/{source}" + pattern: "folders/{folder}/sources/{source}" + pattern: "projects/{project}/sources/{source}" + }; + + // The relative resource name of this source. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/sources/{source_id}" + string name = 1; + + // The source's display name. + // A source's display name must be unique amongst its siblings, for example, + // two sources with the same parent can't share the same display name. + // The display name must have a length between 1 and 64 characters + // (inclusive). + string display_name = 2; + + // The description of the source (max of 1024 characters). + // Example: + // "Web Security Scanner is a web security scanner for common + // vulnerabilities in App Engine applications. It can automatically + // scan and detect four common vulnerabilities, including cross-site-scripting + // (XSS), Flash injection, mixed content (HTTP in HTTPS), and + // outdated/insecure libraries." + string description = 3; + + // The canonical name of the finding. It's either + // "organizations/{organization_id}/sources/{source_id}", + // "folders/{folder_id}/sources/{source_id}" or + // "projects/{project_number}/sources/{source_id}", + // depending on the closest CRM ancestor of the resource associated with the + // finding. + string canonical_name = 14; +} diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts new file mode 100644 index 00000000000..f7220fdf13e --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -0,0 +1,28817 @@ +// 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 securitycenter. */ + namespace securitycenter { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an Access. */ + interface IAccess { + + /** Access principalEmail */ + principalEmail?: (string|null); + + /** Access callerIp */ + callerIp?: (string|null); + + /** Access callerIpGeo */ + callerIpGeo?: (google.cloud.securitycenter.v1.IGeolocation|null); + + /** Access userAgentFamily */ + userAgentFamily?: (string|null); + + /** Access serviceName */ + serviceName?: (string|null); + + /** Access methodName */ + methodName?: (string|null); + + /** Access principalSubject */ + principalSubject?: (string|null); + + /** Access serviceAccountKeyName */ + serviceAccountKeyName?: (string|null); + + /** Access serviceAccountDelegationInfo */ + serviceAccountDelegationInfo?: (google.cloud.securitycenter.v1.IServiceAccountDelegationInfo[]|null); + } + + /** Represents an Access. */ + class Access implements IAccess { + + /** + * Constructs a new Access. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IAccess); + + /** Access principalEmail. */ + public principalEmail: string; + + /** Access callerIp. */ + public callerIp: string; + + /** Access callerIpGeo. */ + public callerIpGeo?: (google.cloud.securitycenter.v1.IGeolocation|null); + + /** Access userAgentFamily. */ + public userAgentFamily: string; + + /** Access serviceName. */ + public serviceName: string; + + /** Access methodName. */ + public methodName: string; + + /** Access principalSubject. */ + public principalSubject: string; + + /** Access serviceAccountKeyName. */ + public serviceAccountKeyName: string; + + /** Access serviceAccountDelegationInfo. */ + public serviceAccountDelegationInfo: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo[]; + + /** + * Creates a new Access instance using the specified properties. + * @param [properties] Properties to set + * @returns Access instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IAccess): google.cloud.securitycenter.v1.Access; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.securitycenter.v1.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Access message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Access; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Access; + + /** + * Verifies an Access message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Access message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Access + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Access; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @param message Access + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Access, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Access to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Access + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceAccountDelegationInfo. */ + interface IServiceAccountDelegationInfo { + + /** ServiceAccountDelegationInfo principalEmail */ + principalEmail?: (string|null); + + /** ServiceAccountDelegationInfo principalSubject */ + principalSubject?: (string|null); + } + + /** Represents a ServiceAccountDelegationInfo. */ + class ServiceAccountDelegationInfo implements IServiceAccountDelegationInfo { + + /** + * Constructs a new ServiceAccountDelegationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo); + + /** ServiceAccountDelegationInfo principalEmail. */ + public principalEmail: string; + + /** ServiceAccountDelegationInfo principalSubject. */ + public principalSubject: string; + + /** + * Creates a new ServiceAccountDelegationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccountDelegationInfo instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo): google.cloud.securitycenter.v1.ServiceAccountDelegationInfo; + + /** + * Encodes the specified ServiceAccountDelegationInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify|verify} messages. + * @param message ServiceAccountDelegationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccountDelegationInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify|verify} messages. + * @param message ServiceAccountDelegationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IServiceAccountDelegationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccountDelegationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccountDelegationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ServiceAccountDelegationInfo; + + /** + * Decodes a ServiceAccountDelegationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccountDelegationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ServiceAccountDelegationInfo; + + /** + * Verifies a ServiceAccountDelegationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAccountDelegationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccountDelegationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ServiceAccountDelegationInfo; + + /** + * Creates a plain object from a ServiceAccountDelegationInfo message. Also converts values to other types if specified. + * @param message ServiceAccountDelegationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ServiceAccountDelegationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccountDelegationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccountDelegationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Geolocation. */ + interface IGeolocation { + + /** Geolocation regionCode */ + regionCode?: (string|null); + } + + /** Represents a Geolocation. */ + class Geolocation implements IGeolocation { + + /** + * Constructs a new Geolocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGeolocation); + + /** Geolocation regionCode. */ + public regionCode: string; + + /** + * Creates a new Geolocation instance using the specified properties. + * @param [properties] Properties to set + * @returns Geolocation instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGeolocation): google.cloud.securitycenter.v1.Geolocation; + + /** + * Encodes the specified Geolocation message. Does not implicitly {@link google.cloud.securitycenter.v1.Geolocation.verify|verify} messages. + * @param message Geolocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGeolocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Geolocation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Geolocation.verify|verify} messages. + * @param message Geolocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGeolocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Geolocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Geolocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Geolocation; + + /** + * Decodes a Geolocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Geolocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Geolocation; + + /** + * Verifies a Geolocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Geolocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Geolocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Geolocation; + + /** + * Creates a plain object from a Geolocation message. Also converts values to other types if specified. + * @param message Geolocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Geolocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Geolocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Geolocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset securityCenterProperties */ + securityCenterProperties?: (google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties */ + resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Asset securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** Asset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.cloud.securitycenter.v1.Asset.IIamPolicy|null); + + /** Asset canonicalName */ + canonicalName?: (string|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset securityCenterProperties. */ + public securityCenterProperties?: (google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties. */ + public resourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Asset securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** Asset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.cloud.securitycenter.v1.Asset.IIamPolicy|null); + + /** Asset canonicalName. */ + public canonicalName: string; + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IAsset): google.cloud.securitycenter.v1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Asset; + + /** + * Verifies an Asset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Asset { + + /** Properties of a SecurityCenterProperties. */ + interface ISecurityCenterProperties { + + /** SecurityCenterProperties resourceName */ + resourceName?: (string|null); + + /** SecurityCenterProperties resourceType */ + resourceType?: (string|null); + + /** SecurityCenterProperties resourceParent */ + resourceParent?: (string|null); + + /** SecurityCenterProperties resourceProject */ + resourceProject?: (string|null); + + /** SecurityCenterProperties resourceOwners */ + resourceOwners?: (string[]|null); + + /** SecurityCenterProperties resourceDisplayName */ + resourceDisplayName?: (string|null); + + /** SecurityCenterProperties resourceParentDisplayName */ + resourceParentDisplayName?: (string|null); + + /** SecurityCenterProperties resourceProjectDisplayName */ + resourceProjectDisplayName?: (string|null); + + /** SecurityCenterProperties folders */ + folders?: (google.cloud.securitycenter.v1.IFolder[]|null); + } + + /** Represents a SecurityCenterProperties. */ + class SecurityCenterProperties implements ISecurityCenterProperties { + + /** + * Constructs a new SecurityCenterProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties); + + /** SecurityCenterProperties resourceName. */ + public resourceName: string; + + /** SecurityCenterProperties resourceType. */ + public resourceType: string; + + /** SecurityCenterProperties resourceParent. */ + public resourceParent: string; + + /** SecurityCenterProperties resourceProject. */ + public resourceProject: string; + + /** SecurityCenterProperties resourceOwners. */ + public resourceOwners: string[]; + + /** SecurityCenterProperties resourceDisplayName. */ + public resourceDisplayName: string; + + /** SecurityCenterProperties resourceParentDisplayName. */ + public resourceParentDisplayName: string; + + /** SecurityCenterProperties resourceProjectDisplayName. */ + public resourceProjectDisplayName: string; + + /** SecurityCenterProperties folders. */ + public folders: google.cloud.securitycenter.v1.IFolder[]; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityCenterProperties instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties): google.cloud.securitycenter.v1.Asset.SecurityCenterProperties; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Asset.SecurityCenterProperties; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Asset.SecurityCenterProperties; + + /** + * Verifies a SecurityCenterProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityCenterProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Asset.SecurityCenterProperties; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @param message SecurityCenterProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Asset.SecurityCenterProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityCenterProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IamPolicy. */ + interface IIamPolicy { + + /** IamPolicy policyBlob */ + policyBlob?: (string|null); + } + + /** Represents an IamPolicy. */ + class IamPolicy implements IIamPolicy { + + /** + * Constructs a new IamPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Asset.IIamPolicy); + + /** IamPolicy policyBlob. */ + public policyBlob: string; + + /** + * Creates a new IamPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicy instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Asset.IIamPolicy): google.cloud.securitycenter.v1.Asset.IamPolicy; + + /** + * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @param message IamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Asset.IIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @param message IamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Asset.IIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Asset.IamPolicy; + + /** + * Decodes an IamPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Asset.IamPolicy; + + /** + * Verifies an IamPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IamPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Asset.IamPolicy; + + /** + * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. + * @param message IamPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Asset.IamPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Folder. */ + interface IFolder { + + /** Folder resourceFolder */ + resourceFolder?: (string|null); + + /** Folder resourceFolderDisplayName */ + resourceFolderDisplayName?: (string|null); + } + + /** Represents a Folder. */ + class Folder implements IFolder { + + /** + * Constructs a new Folder. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IFolder); + + /** Folder resourceFolder. */ + public resourceFolder: string; + + /** Folder resourceFolderDisplayName. */ + public resourceFolderDisplayName: string; + + /** + * Creates a new Folder instance using the specified properties. + * @param [properties] Properties to set + * @returns Folder instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IFolder): google.cloud.securitycenter.v1.Folder; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v1.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Folder; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Folder; + + /** + * Verifies a Folder message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Folder message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Folder + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Folder; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @param message Folder + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Folder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Folder to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Folder + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecurityMarks. */ + interface ISecurityMarks { + + /** SecurityMarks name */ + name?: (string|null); + + /** SecurityMarks marks */ + marks?: ({ [k: string]: string }|null); + + /** SecurityMarks canonicalName */ + canonicalName?: (string|null); + } + + /** Represents a SecurityMarks. */ + class SecurityMarks implements ISecurityMarks { + + /** + * Constructs a new SecurityMarks. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISecurityMarks); + + /** SecurityMarks name. */ + public name: string; + + /** SecurityMarks marks. */ + public marks: { [k: string]: string }; + + /** SecurityMarks canonicalName. */ + public canonicalName: string; + + /** + * Creates a new SecurityMarks instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityMarks instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISecurityMarks): google.cloud.securitycenter.v1.SecurityMarks; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.SecurityMarks; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.SecurityMarks; + + /** + * Verifies a SecurityMarks message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityMarks + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SecurityMarks; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @param message SecurityMarks + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityMarks to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityMarks + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigQueryExport. */ + interface IBigQueryExport { + + /** BigQueryExport name */ + name?: (string|null); + + /** BigQueryExport description */ + description?: (string|null); + + /** BigQueryExport filter */ + filter?: (string|null); + + /** BigQueryExport dataset */ + dataset?: (string|null); + + /** BigQueryExport createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BigQueryExport updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BigQueryExport mostRecentEditor */ + mostRecentEditor?: (string|null); + + /** BigQueryExport principal */ + principal?: (string|null); + } + + /** Represents a BigQueryExport. */ + class BigQueryExport implements IBigQueryExport { + + /** + * Constructs a new BigQueryExport. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IBigQueryExport); + + /** BigQueryExport name. */ + public name: string; + + /** BigQueryExport description. */ + public description: string; + + /** BigQueryExport filter. */ + public filter: string; + + /** BigQueryExport dataset. */ + public dataset: string; + + /** BigQueryExport createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BigQueryExport updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BigQueryExport mostRecentEditor. */ + public mostRecentEditor: string; + + /** BigQueryExport principal. */ + public principal: string; + + /** + * Creates a new BigQueryExport instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryExport instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IBigQueryExport): google.cloud.securitycenter.v1.BigQueryExport; + + /** + * Encodes the specified BigQueryExport message. Does not implicitly {@link google.cloud.securitycenter.v1.BigQueryExport.verify|verify} messages. + * @param message BigQueryExport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IBigQueryExport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryExport message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BigQueryExport.verify|verify} messages. + * @param message BigQueryExport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IBigQueryExport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryExport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryExport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.BigQueryExport; + + /** + * Decodes a BigQueryExport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryExport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.BigQueryExport; + + /** + * Verifies a BigQueryExport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryExport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryExport + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BigQueryExport; + + /** + * Creates a plain object from a BigQueryExport message. Also converts values to other types if specified. + * @param message BigQueryExport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.BigQueryExport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryExport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryExport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Compliance. */ + interface ICompliance { + + /** Compliance standard */ + standard?: (string|null); + + /** Compliance version */ + version?: (string|null); + + /** Compliance ids */ + ids?: (string[]|null); + } + + /** Represents a Compliance. */ + class Compliance implements ICompliance { + + /** + * Constructs a new Compliance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICompliance); + + /** Compliance standard. */ + public standard: string; + + /** Compliance version. */ + public version: string; + + /** Compliance ids. */ + public ids: string[]; + + /** + * Creates a new Compliance instance using the specified properties. + * @param [properties] Properties to set + * @returns Compliance instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICompliance): google.cloud.securitycenter.v1.Compliance; + + /** + * Encodes the specified Compliance message. Does not implicitly {@link google.cloud.securitycenter.v1.Compliance.verify|verify} messages. + * @param message Compliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Compliance message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Compliance.verify|verify} messages. + * @param message Compliance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICompliance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Compliance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Compliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Compliance; + + /** + * Decodes a Compliance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Compliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Compliance; + + /** + * Verifies a Compliance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Compliance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Compliance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Compliance; + + /** + * Creates a plain object from a Compliance message. Also converts values to other types if specified. + * @param message Compliance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Compliance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Compliance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Compliance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Connection. */ + interface IConnection { + + /** Connection destinationIp */ + destinationIp?: (string|null); + + /** Connection destinationPort */ + destinationPort?: (number|null); + + /** Connection sourceIp */ + sourceIp?: (string|null); + + /** Connection sourcePort */ + sourcePort?: (number|null); + + /** Connection protocol */ + protocol?: (google.cloud.securitycenter.v1.Connection.Protocol|keyof typeof google.cloud.securitycenter.v1.Connection.Protocol|null); + } + + /** Represents a Connection. */ + class Connection implements IConnection { + + /** + * Constructs a new Connection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IConnection); + + /** Connection destinationIp. */ + public destinationIp: string; + + /** Connection destinationPort. */ + public destinationPort: number; + + /** Connection sourceIp. */ + public sourceIp: string; + + /** Connection sourcePort. */ + public sourcePort: number; + + /** Connection protocol. */ + public protocol: (google.cloud.securitycenter.v1.Connection.Protocol|keyof typeof google.cloud.securitycenter.v1.Connection.Protocol); + + /** + * Creates a new Connection instance using the specified properties. + * @param [properties] Properties to set + * @returns Connection instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IConnection): google.cloud.securitycenter.v1.Connection; + + /** + * Encodes the specified Connection message. Does not implicitly {@link google.cloud.securitycenter.v1.Connection.verify|verify} messages. + * @param message Connection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Connection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Connection.verify|verify} messages. + * @param message Connection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Connection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Connection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Connection; + + /** + * Decodes a Connection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Connection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Connection; + + /** + * Verifies a Connection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Connection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Connection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Connection; + + /** + * Creates a plain object from a Connection message. Also converts values to other types if specified. + * @param message Connection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Connection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Connection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Connection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Connection { + + /** Protocol enum. */ + enum Protocol { + PROTOCOL_UNSPECIFIED = 0, + ICMP = 1, + TCP = 6, + UDP = 17, + GRE = 47, + ESP = 50 + } + } + + /** Properties of a ContactDetails. */ + interface IContactDetails { + + /** ContactDetails contacts */ + contacts?: (google.cloud.securitycenter.v1.IContact[]|null); + } + + /** Represents a ContactDetails. */ + class ContactDetails implements IContactDetails { + + /** + * Constructs a new ContactDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IContactDetails); + + /** ContactDetails contacts. */ + public contacts: google.cloud.securitycenter.v1.IContact[]; + + /** + * Creates a new ContactDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns ContactDetails instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IContactDetails): google.cloud.securitycenter.v1.ContactDetails; + + /** + * Encodes the specified ContactDetails message. Does not implicitly {@link google.cloud.securitycenter.v1.ContactDetails.verify|verify} messages. + * @param message ContactDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IContactDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContactDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ContactDetails.verify|verify} messages. + * @param message ContactDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IContactDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContactDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContactDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ContactDetails; + + /** + * Decodes a ContactDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContactDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ContactDetails; + + /** + * Verifies a ContactDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContactDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContactDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ContactDetails; + + /** + * Creates a plain object from a ContactDetails message. Also converts values to other types if specified. + * @param message ContactDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ContactDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContactDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContactDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Contact. */ + interface IContact { + + /** Contact email */ + email?: (string|null); + } + + /** Represents a Contact. */ + class Contact implements IContact { + + /** + * Constructs a new Contact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IContact); + + /** Contact email. */ + public email: string; + + /** + * Creates a new Contact instance using the specified properties. + * @param [properties] Properties to set + * @returns Contact instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IContact): google.cloud.securitycenter.v1.Contact; + + /** + * Encodes the specified Contact message. Does not implicitly {@link google.cloud.securitycenter.v1.Contact.verify|verify} messages. + * @param message Contact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IContact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Contact message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Contact.verify|verify} messages. + * @param message Contact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IContact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Contact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Contact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Contact; + + /** + * Decodes a Contact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Contact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Contact; + + /** + * Verifies a Contact message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Contact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Contact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Contact; + + /** + * Creates a plain object from a Contact message. Also converts values to other types if specified. + * @param message Contact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Contact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Contact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Contact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Container. */ + interface IContainer { + + /** Container name */ + name?: (string|null); + + /** Container uri */ + uri?: (string|null); + + /** Container imageId */ + imageId?: (string|null); + + /** Container labels */ + labels?: (google.cloud.securitycenter.v1.ILabel[]|null); + } + + /** Represents a Container. */ + class Container implements IContainer { + + /** + * Constructs a new Container. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IContainer); + + /** Container name. */ + public name: string; + + /** Container uri. */ + public uri: string; + + /** Container imageId. */ + public imageId: string; + + /** Container labels. */ + public labels: google.cloud.securitycenter.v1.ILabel[]; + + /** + * Creates a new Container instance using the specified properties. + * @param [properties] Properties to set + * @returns Container instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IContainer): google.cloud.securitycenter.v1.Container; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.securitycenter.v1.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Container message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Container; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Container; + + /** + * Verifies a Container message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Container + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Container; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @param message Container + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Container to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Container + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Label. */ + interface ILabel { + + /** Label name */ + name?: (string|null); + + /** Label value */ + value?: (string|null); + } + + /** Represents a Label. */ + class Label implements ILabel { + + /** + * Constructs a new Label. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ILabel); + + /** Label name. */ + public name: string; + + /** Label value. */ + public value: string; + + /** + * Creates a new Label instance using the specified properties. + * @param [properties] Properties to set + * @returns Label instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ILabel): google.cloud.securitycenter.v1.Label; + + /** + * Encodes the specified Label message. Does not implicitly {@link google.cloud.securitycenter.v1.Label.verify|verify} messages. + * @param message Label message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ILabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Label message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Label.verify|verify} messages. + * @param message Label message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ILabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Label message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Label + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Label; + + /** + * Decodes a Label message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Label + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Label; + + /** + * Verifies a Label message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Label message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Label + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Label; + + /** + * Creates a plain object from a Label message. Also converts values to other types if specified. + * @param message Label + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Label, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Label to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Label + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Database. */ + interface IDatabase { + + /** Database name */ + name?: (string|null); + + /** Database displayName */ + displayName?: (string|null); + + /** Database userName */ + userName?: (string|null); + + /** Database query */ + query?: (string|null); + + /** Database grantees */ + grantees?: (string[]|null); + } + + /** Represents a Database. */ + class Database implements IDatabase { + + /** + * Constructs a new Database. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IDatabase); + + /** Database name. */ + public name: string; + + /** Database displayName. */ + public displayName: string; + + /** Database userName. */ + public userName: string; + + /** Database query. */ + public query: string; + + /** Database grantees. */ + public grantees: string[]; + + /** + * Creates a new Database instance using the specified properties. + * @param [properties] Properties to set + * @returns Database instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IDatabase): google.cloud.securitycenter.v1.Database; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.securitycenter.v1.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Database message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Database; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Database; + + /** + * Verifies a Database message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Database + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Database; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @param message Database + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Database to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Database + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Exfiltration. */ + interface IExfiltration { + + /** Exfiltration sources */ + sources?: (google.cloud.securitycenter.v1.IExfilResource[]|null); + + /** Exfiltration targets */ + targets?: (google.cloud.securitycenter.v1.IExfilResource[]|null); + } + + /** Represents an Exfiltration. */ + class Exfiltration implements IExfiltration { + + /** + * Constructs a new Exfiltration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IExfiltration); + + /** Exfiltration sources. */ + public sources: google.cloud.securitycenter.v1.IExfilResource[]; + + /** Exfiltration targets. */ + public targets: google.cloud.securitycenter.v1.IExfilResource[]; + + /** + * Creates a new Exfiltration instance using the specified properties. + * @param [properties] Properties to set + * @returns Exfiltration instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IExfiltration): google.cloud.securitycenter.v1.Exfiltration; + + /** + * Encodes the specified Exfiltration message. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. + * @param message Exfiltration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IExfiltration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Exfiltration message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. + * @param message Exfiltration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IExfiltration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Exfiltration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Exfiltration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Exfiltration; + + /** + * Decodes an Exfiltration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Exfiltration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Exfiltration; + + /** + * Verifies an Exfiltration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Exfiltration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Exfiltration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Exfiltration; + + /** + * Creates a plain object from an Exfiltration message. Also converts values to other types if specified. + * @param message Exfiltration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Exfiltration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Exfiltration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Exfiltration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExfilResource. */ + interface IExfilResource { + + /** ExfilResource name */ + name?: (string|null); + + /** ExfilResource components */ + components?: (string[]|null); + } + + /** Represents an ExfilResource. */ + class ExfilResource implements IExfilResource { + + /** + * Constructs a new ExfilResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IExfilResource); + + /** ExfilResource name. */ + public name: string; + + /** ExfilResource components. */ + public components: string[]; + + /** + * Creates a new ExfilResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ExfilResource instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IExfilResource): google.cloud.securitycenter.v1.ExfilResource; + + /** + * Encodes the specified ExfilResource message. Does not implicitly {@link google.cloud.securitycenter.v1.ExfilResource.verify|verify} messages. + * @param message ExfilResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IExfilResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExfilResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExfilResource.verify|verify} messages. + * @param message ExfilResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IExfilResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExfilResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExfilResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ExfilResource; + + /** + * Decodes an ExfilResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExfilResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ExfilResource; + + /** + * Verifies an ExfilResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExfilResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExfilResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ExfilResource; + + /** + * Creates a plain object from an ExfilResource message. Also converts values to other types if specified. + * @param message ExfilResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ExfilResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExfilResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExfilResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExternalSystem. */ + interface IExternalSystem { + + /** ExternalSystem name */ + name?: (string|null); + + /** ExternalSystem assignees */ + assignees?: (string[]|null); + + /** ExternalSystem externalUid */ + externalUid?: (string|null); + + /** ExternalSystem status */ + status?: (string|null); + + /** ExternalSystem externalSystemUpdateTime */ + externalSystemUpdateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an ExternalSystem. */ + class ExternalSystem implements IExternalSystem { + + /** + * Constructs a new ExternalSystem. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IExternalSystem); + + /** ExternalSystem name. */ + public name: string; + + /** ExternalSystem assignees. */ + public assignees: string[]; + + /** ExternalSystem externalUid. */ + public externalUid: string; + + /** ExternalSystem status. */ + public status: string; + + /** ExternalSystem externalSystemUpdateTime. */ + public externalSystemUpdateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ExternalSystem instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalSystem instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IExternalSystem): google.cloud.securitycenter.v1.ExternalSystem; + + /** + * Encodes the specified ExternalSystem message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * @param message ExternalSystem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IExternalSystem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalSystem message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * @param message ExternalSystem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IExternalSystem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalSystem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalSystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ExternalSystem; + + /** + * Decodes an ExternalSystem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalSystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ExternalSystem; + + /** + * Verifies an ExternalSystem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExternalSystem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalSystem + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ExternalSystem; + + /** + * Creates a plain object from an ExternalSystem message. Also converts values to other types if specified. + * @param message ExternalSystem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ExternalSystem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalSystem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExternalSystem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a File. */ + interface IFile { + + /** File path */ + path?: (string|null); + + /** File size */ + size?: (number|Long|string|null); + + /** File sha256 */ + sha256?: (string|null); + + /** File hashedSize */ + hashedSize?: (number|Long|string|null); + + /** File partiallyHashed */ + partiallyHashed?: (boolean|null); + + /** File contents */ + contents?: (string|null); + } + + /** Represents a File. */ + class File implements IFile { + + /** + * Constructs a new File. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IFile); + + /** File path. */ + public path: string; + + /** File size. */ + public size: (number|Long|string); + + /** File sha256. */ + public sha256: string; + + /** File hashedSize. */ + public hashedSize: (number|Long|string); + + /** File partiallyHashed. */ + public partiallyHashed: boolean; + + /** File contents. */ + public contents: string; + + /** + * Creates a new File instance using the specified properties. + * @param [properties] Properties to set + * @returns File instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IFile): google.cloud.securitycenter.v1.File; + + /** + * Encodes the specified File message. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. + * @param message File message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IFile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. + * @param message File message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IFile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a File message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns File + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.File; + + /** + * Decodes a File message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns File + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.File; + + /** + * Verifies a File message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a File message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns File + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.File; + + /** + * Creates a plain object from a File message. Also converts values to other types if specified. + * @param message File + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.File, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this File to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for File + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Finding. */ + interface IFinding { + + /** Finding name */ + name?: (string|null); + + /** Finding parent */ + parent?: (string|null); + + /** Finding resourceName */ + resourceName?: (string|null); + + /** Finding state */ + state?: (google.cloud.securitycenter.v1.Finding.State|keyof typeof google.cloud.securitycenter.v1.Finding.State|null); + + /** Finding category */ + category?: (string|null); + + /** Finding externalUri */ + externalUri?: (string|null); + + /** Finding sourceProperties */ + sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Finding securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** Finding eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Finding severity */ + severity?: (google.cloud.securitycenter.v1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1.Finding.Severity|null); + + /** Finding canonicalName */ + canonicalName?: (string|null); + + /** Finding mute */ + mute?: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute|null); + + /** Finding findingClass */ + findingClass?: (google.cloud.securitycenter.v1.Finding.FindingClass|keyof typeof google.cloud.securitycenter.v1.Finding.FindingClass|null); + + /** Finding indicator */ + indicator?: (google.cloud.securitycenter.v1.IIndicator|null); + + /** Finding vulnerability */ + vulnerability?: (google.cloud.securitycenter.v1.IVulnerability|null); + + /** Finding muteUpdateTime */ + muteUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Finding externalSystems */ + externalSystems?: ({ [k: string]: google.cloud.securitycenter.v1.IExternalSystem }|null); + + /** Finding mitreAttack */ + mitreAttack?: (google.cloud.securitycenter.v1.IMitreAttack|null); + + /** Finding access */ + access?: (google.cloud.securitycenter.v1.IAccess|null); + + /** Finding connections */ + connections?: (google.cloud.securitycenter.v1.IConnection[]|null); + + /** Finding muteInitiator */ + muteInitiator?: (string|null); + + /** Finding processes */ + processes?: (google.cloud.securitycenter.v1.IProcess[]|null); + + /** Finding contacts */ + contacts?: ({ [k: string]: google.cloud.securitycenter.v1.IContactDetails }|null); + + /** Finding compliances */ + compliances?: (google.cloud.securitycenter.v1.ICompliance[]|null); + + /** Finding parentDisplayName */ + parentDisplayName?: (string|null); + + /** Finding description */ + description?: (string|null); + + /** Finding exfiltration */ + exfiltration?: (google.cloud.securitycenter.v1.IExfiltration|null); + + /** Finding iamBindings */ + iamBindings?: (google.cloud.securitycenter.v1.IIamBinding[]|null); + + /** Finding nextSteps */ + nextSteps?: (string|null); + + /** Finding containers */ + containers?: (google.cloud.securitycenter.v1.IContainer[]|null); + + /** Finding kubernetes */ + kubernetes?: (google.cloud.securitycenter.v1.IKubernetes|null); + + /** Finding database */ + database?: (google.cloud.securitycenter.v1.IDatabase|null); + + /** Finding files */ + files?: (google.cloud.securitycenter.v1.IFile[]|null); + } + + /** Represents a Finding. */ + class Finding implements IFinding { + + /** + * Constructs a new Finding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IFinding); + + /** Finding name. */ + public name: string; + + /** Finding parent. */ + public parent: string; + + /** Finding resourceName. */ + public resourceName: string; + + /** Finding state. */ + public state: (google.cloud.securitycenter.v1.Finding.State|keyof typeof google.cloud.securitycenter.v1.Finding.State); + + /** Finding category. */ + public category: string; + + /** Finding externalUri. */ + public externalUri: string; + + /** Finding sourceProperties. */ + public sourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Finding securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** Finding eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Finding severity. */ + public severity: (google.cloud.securitycenter.v1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1.Finding.Severity); + + /** Finding canonicalName. */ + public canonicalName: string; + + /** Finding mute. */ + public mute: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute); + + /** Finding findingClass. */ + public findingClass: (google.cloud.securitycenter.v1.Finding.FindingClass|keyof typeof google.cloud.securitycenter.v1.Finding.FindingClass); + + /** Finding indicator. */ + public indicator?: (google.cloud.securitycenter.v1.IIndicator|null); + + /** Finding vulnerability. */ + public vulnerability?: (google.cloud.securitycenter.v1.IVulnerability|null); + + /** Finding muteUpdateTime. */ + public muteUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Finding externalSystems. */ + public externalSystems: { [k: string]: google.cloud.securitycenter.v1.IExternalSystem }; + + /** Finding mitreAttack. */ + public mitreAttack?: (google.cloud.securitycenter.v1.IMitreAttack|null); + + /** Finding access. */ + public access?: (google.cloud.securitycenter.v1.IAccess|null); + + /** Finding connections. */ + public connections: google.cloud.securitycenter.v1.IConnection[]; + + /** Finding muteInitiator. */ + public muteInitiator: string; + + /** Finding processes. */ + public processes: google.cloud.securitycenter.v1.IProcess[]; + + /** Finding contacts. */ + public contacts: { [k: string]: google.cloud.securitycenter.v1.IContactDetails }; + + /** Finding compliances. */ + public compliances: google.cloud.securitycenter.v1.ICompliance[]; + + /** Finding parentDisplayName. */ + public parentDisplayName: string; + + /** Finding description. */ + public description: string; + + /** Finding exfiltration. */ + public exfiltration?: (google.cloud.securitycenter.v1.IExfiltration|null); + + /** Finding iamBindings. */ + public iamBindings: google.cloud.securitycenter.v1.IIamBinding[]; + + /** Finding nextSteps. */ + public nextSteps: string; + + /** Finding containers. */ + public containers: google.cloud.securitycenter.v1.IContainer[]; + + /** Finding kubernetes. */ + public kubernetes?: (google.cloud.securitycenter.v1.IKubernetes|null); + + /** Finding database. */ + public database?: (google.cloud.securitycenter.v1.IDatabase|null); + + /** Finding files. */ + public files: google.cloud.securitycenter.v1.IFile[]; + + /** + * Creates a new Finding instance using the specified properties. + * @param [properties] Properties to set + * @returns Finding instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IFinding): google.cloud.securitycenter.v1.Finding; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.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.securitycenter.v1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.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.securitycenter.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.securitycenter.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.securitycenter.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.securitycenter.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.securitycenter.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 { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2 + } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + CRITICAL = 1, + HIGH = 2, + MEDIUM = 3, + LOW = 4 + } + + /** Mute enum. */ + enum Mute { + MUTE_UNSPECIFIED = 0, + MUTED = 1, + UNMUTED = 2, + UNDEFINED = 4 + } + + /** FindingClass enum. */ + enum FindingClass { + FINDING_CLASS_UNSPECIFIED = 0, + THREAT = 1, + VULNERABILITY = 2, + MISCONFIGURATION = 3, + OBSERVATION = 4, + SCC_ERROR = 5 + } + } + + /** Properties of an IamBinding. */ + interface IIamBinding { + + /** IamBinding action */ + action?: (google.cloud.securitycenter.v1.IamBinding.Action|keyof typeof google.cloud.securitycenter.v1.IamBinding.Action|null); + + /** IamBinding role */ + role?: (string|null); + + /** IamBinding member */ + member?: (string|null); + } + + /** Represents an IamBinding. */ + class IamBinding implements IIamBinding { + + /** + * Constructs a new IamBinding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IIamBinding); + + /** IamBinding action. */ + public action: (google.cloud.securitycenter.v1.IamBinding.Action|keyof typeof google.cloud.securitycenter.v1.IamBinding.Action); + + /** IamBinding role. */ + public role: string; + + /** IamBinding member. */ + public member: string; + + /** + * Creates a new IamBinding instance using the specified properties. + * @param [properties] Properties to set + * @returns IamBinding instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IIamBinding): google.cloud.securitycenter.v1.IamBinding; + + /** + * Encodes the specified IamBinding message. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * @param message IamBinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IIamBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamBinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * @param message IamBinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IIamBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamBinding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.IamBinding; + + /** + * Decodes an IamBinding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.IamBinding; + + /** + * Verifies an IamBinding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IamBinding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamBinding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.IamBinding; + + /** + * Creates a plain object from an IamBinding message. Also converts values to other types if specified. + * @param message IamBinding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.IamBinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamBinding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamBinding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IamBinding { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an Indicator. */ + interface IIndicator { + + /** Indicator ipAddresses */ + ipAddresses?: (string[]|null); + + /** Indicator domains */ + domains?: (string[]|null); + + /** Indicator signatures */ + signatures?: (google.cloud.securitycenter.v1.Indicator.IProcessSignature[]|null); + + /** Indicator uris */ + uris?: (string[]|null); + } + + /** Represents an Indicator. */ + class Indicator implements IIndicator { + + /** + * Constructs a new Indicator. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IIndicator); + + /** Indicator ipAddresses. */ + public ipAddresses: string[]; + + /** Indicator domains. */ + public domains: string[]; + + /** Indicator signatures. */ + public signatures: google.cloud.securitycenter.v1.Indicator.IProcessSignature[]; + + /** Indicator uris. */ + public uris: string[]; + + /** + * Creates a new Indicator instance using the specified properties. + * @param [properties] Properties to set + * @returns Indicator instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IIndicator): google.cloud.securitycenter.v1.Indicator; + + /** + * Encodes the specified Indicator message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. + * @param message Indicator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IIndicator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. + * @param message Indicator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IIndicator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Indicator message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Indicator; + + /** + * Decodes an Indicator message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Indicator; + + /** + * Verifies an Indicator message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Indicator message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Indicator + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Indicator; + + /** + * Creates a plain object from an Indicator message. Also converts values to other types if specified. + * @param message Indicator + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Indicator, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Indicator to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Indicator + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Indicator { + + /** Properties of a ProcessSignature. */ + interface IProcessSignature { + + /** ProcessSignature memoryHashSignature */ + memoryHashSignature?: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature|null); + + /** ProcessSignature yaraRuleSignature */ + yaraRuleSignature?: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature|null); + } + + /** Represents a ProcessSignature. */ + class ProcessSignature implements IProcessSignature { + + /** + * Constructs a new ProcessSignature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Indicator.IProcessSignature); + + /** ProcessSignature memoryHashSignature. */ + public memoryHashSignature?: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature|null); + + /** ProcessSignature yaraRuleSignature. */ + public yaraRuleSignature?: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature|null); + + /** ProcessSignature signature. */ + public signature?: ("memoryHashSignature"|"yaraRuleSignature"); + + /** + * Creates a new ProcessSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessSignature instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Indicator.IProcessSignature): google.cloud.securitycenter.v1.Indicator.ProcessSignature; + + /** + * Encodes the specified ProcessSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify|verify} messages. + * @param message ProcessSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Indicator.IProcessSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify|verify} messages. + * @param message ProcessSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Indicator.IProcessSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessSignature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Indicator.ProcessSignature; + + /** + * Decodes a ProcessSignature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Indicator.ProcessSignature; + + /** + * Verifies a ProcessSignature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessSignature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessSignature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Indicator.ProcessSignature; + + /** + * Creates a plain object from a ProcessSignature message. Also converts values to other types if specified. + * @param message ProcessSignature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessSignature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ProcessSignature { + + /** Properties of a MemoryHashSignature. */ + interface IMemoryHashSignature { + + /** MemoryHashSignature binaryFamily */ + binaryFamily?: (string|null); + + /** MemoryHashSignature detections */ + detections?: (google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection[]|null); + } + + /** Represents a MemoryHashSignature. */ + class MemoryHashSignature implements IMemoryHashSignature { + + /** + * Constructs a new MemoryHashSignature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature); + + /** MemoryHashSignature binaryFamily. */ + public binaryFamily: string; + + /** MemoryHashSignature detections. */ + public detections: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection[]; + + /** + * Creates a new MemoryHashSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns MemoryHashSignature instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature): google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature; + + /** + * Encodes the specified MemoryHashSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. + * @param message MemoryHashSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MemoryHashSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. + * @param message MemoryHashSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MemoryHashSignature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MemoryHashSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature; + + /** + * Decodes a MemoryHashSignature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MemoryHashSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature; + + /** + * Verifies a MemoryHashSignature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MemoryHashSignature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MemoryHashSignature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature; + + /** + * Creates a plain object from a MemoryHashSignature message. Also converts values to other types if specified. + * @param message MemoryHashSignature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MemoryHashSignature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MemoryHashSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MemoryHashSignature { + + /** Properties of a Detection. */ + interface IDetection { + + /** Detection binary */ + binary?: (string|null); + + /** Detection percentPagesMatched */ + percentPagesMatched?: (number|null); + } + + /** Represents a Detection. */ + class Detection implements IDetection { + + /** + * Constructs a new Detection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection); + + /** Detection binary. */ + public binary: string; + + /** Detection percentPagesMatched. */ + public percentPagesMatched: number; + + /** + * Creates a new Detection instance using the specified properties. + * @param [properties] Properties to set + * @returns Detection instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection): google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection; + + /** + * Encodes the specified Detection message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. + * @param message Detection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Detection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. + * @param message Detection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Detection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Detection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection; + + /** + * Decodes a Detection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Detection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection; + + /** + * Verifies a Detection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Detection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Detection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection; + + /** + * Creates a plain object from a Detection message. Also converts values to other types if specified. + * @param message Detection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Detection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Detection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a YaraRuleSignature. */ + interface IYaraRuleSignature { + + /** YaraRuleSignature yaraRule */ + yaraRule?: (string|null); + } + + /** Represents a YaraRuleSignature. */ + class YaraRuleSignature implements IYaraRuleSignature { + + /** + * Constructs a new YaraRuleSignature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature); + + /** YaraRuleSignature yaraRule. */ + public yaraRule: string; + + /** + * Creates a new YaraRuleSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns YaraRuleSignature instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature): google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature; + + /** + * Encodes the specified YaraRuleSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. + * @param message YaraRuleSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified YaraRuleSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. + * @param message YaraRuleSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a YaraRuleSignature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns YaraRuleSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature; + + /** + * Decodes a YaraRuleSignature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns YaraRuleSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature; + + /** + * Verifies a YaraRuleSignature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a YaraRuleSignature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns YaraRuleSignature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature; + + /** + * Creates a plain object from a YaraRuleSignature message. Also converts values to other types if specified. + * @param message YaraRuleSignature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this YaraRuleSignature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for YaraRuleSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Kubernetes. */ + interface IKubernetes { + + /** Kubernetes pods */ + pods?: (google.cloud.securitycenter.v1.Kubernetes.IPod[]|null); + + /** Kubernetes nodes */ + nodes?: (google.cloud.securitycenter.v1.Kubernetes.INode[]|null); + + /** Kubernetes nodePools */ + nodePools?: (google.cloud.securitycenter.v1.Kubernetes.INodePool[]|null); + + /** Kubernetes roles */ + roles?: (google.cloud.securitycenter.v1.Kubernetes.IRole[]|null); + + /** Kubernetes bindings */ + bindings?: (google.cloud.securitycenter.v1.Kubernetes.IBinding[]|null); + + /** Kubernetes accessReviews */ + accessReviews?: (google.cloud.securitycenter.v1.Kubernetes.IAccessReview[]|null); + } + + /** Represents a Kubernetes. */ + class Kubernetes implements IKubernetes { + + /** + * Constructs a new Kubernetes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IKubernetes); + + /** Kubernetes pods. */ + public pods: google.cloud.securitycenter.v1.Kubernetes.IPod[]; + + /** Kubernetes nodes. */ + public nodes: google.cloud.securitycenter.v1.Kubernetes.INode[]; + + /** Kubernetes nodePools. */ + public nodePools: google.cloud.securitycenter.v1.Kubernetes.INodePool[]; + + /** Kubernetes roles. */ + public roles: google.cloud.securitycenter.v1.Kubernetes.IRole[]; + + /** Kubernetes bindings. */ + public bindings: google.cloud.securitycenter.v1.Kubernetes.IBinding[]; + + /** Kubernetes accessReviews. */ + public accessReviews: google.cloud.securitycenter.v1.Kubernetes.IAccessReview[]; + + /** + * Creates a new Kubernetes instance using the specified properties. + * @param [properties] Properties to set + * @returns Kubernetes instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IKubernetes): google.cloud.securitycenter.v1.Kubernetes; + + /** + * Encodes the specified Kubernetes message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.verify|verify} messages. + * @param message Kubernetes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IKubernetes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Kubernetes message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.verify|verify} messages. + * @param message Kubernetes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IKubernetes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Kubernetes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Kubernetes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Kubernetes; + + /** + * Decodes a Kubernetes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Kubernetes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Kubernetes; + + /** + * Verifies a Kubernetes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Kubernetes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Kubernetes + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes; + + /** + * Creates a plain object from a Kubernetes message. Also converts values to other types if specified. + * @param message Kubernetes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Kubernetes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Kubernetes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Kubernetes { + + /** Properties of a Pod. */ + interface IPod { + + /** Pod ns */ + ns?: (string|null); + + /** Pod name */ + name?: (string|null); + + /** Pod labels */ + labels?: (google.cloud.securitycenter.v1.ILabel[]|null); + + /** Pod containers */ + containers?: (google.cloud.securitycenter.v1.IContainer[]|null); + } + + /** Represents a Pod. */ + class Pod implements IPod { + + /** + * Constructs a new Pod. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.IPod); + + /** Pod ns. */ + public ns: string; + + /** Pod name. */ + public name: string; + + /** Pod labels. */ + public labels: google.cloud.securitycenter.v1.ILabel[]; + + /** Pod containers. */ + public containers: google.cloud.securitycenter.v1.IContainer[]; + + /** + * Creates a new Pod instance using the specified properties. + * @param [properties] Properties to set + * @returns Pod instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.IPod): google.cloud.securitycenter.v1.Kubernetes.Pod; + + /** + * Encodes the specified Pod message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Pod.verify|verify} messages. + * @param message Pod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.IPod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Pod message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Pod.verify|verify} messages. + * @param message Pod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.IPod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Pod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Pod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Kubernetes.Pod; + + /** + * Decodes a Pod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Pod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Kubernetes.Pod; + + /** + * Verifies a Pod message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Pod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Pod + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.Pod; + + /** + * Creates a plain object from a Pod message. Also converts values to other types if specified. + * @param message Pod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.Pod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Pod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Pod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Node. */ + interface INode { + + /** Node name */ + name?: (string|null); + } + + /** Represents a Node. */ + class Node implements INode { + + /** + * Constructs a new Node. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.INode); + + /** Node name. */ + public name: string; + + /** + * Creates a new Node instance using the specified properties. + * @param [properties] Properties to set + * @returns Node instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.INode): google.cloud.securitycenter.v1.Kubernetes.Node; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Node message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Kubernetes.Node; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Kubernetes.Node; + + /** + * Verifies a Node message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Node + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.Node; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Node to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Node + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodePool. */ + interface INodePool { + + /** NodePool name */ + name?: (string|null); + + /** NodePool nodes */ + nodes?: (google.cloud.securitycenter.v1.Kubernetes.INode[]|null); + } + + /** Represents a NodePool. */ + class NodePool implements INodePool { + + /** + * Constructs a new NodePool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.INodePool); + + /** NodePool name. */ + public name: string; + + /** NodePool nodes. */ + public nodes: google.cloud.securitycenter.v1.Kubernetes.INode[]; + + /** + * Creates a new NodePool instance using the specified properties. + * @param [properties] Properties to set + * @returns NodePool instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.INodePool): google.cloud.securitycenter.v1.Kubernetes.NodePool; + + /** + * Encodes the specified NodePool message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.NodePool.verify|verify} messages. + * @param message NodePool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.INodePool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodePool message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.NodePool.verify|verify} messages. + * @param message NodePool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.INodePool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodePool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Kubernetes.NodePool; + + /** + * Decodes a NodePool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Kubernetes.NodePool; + + /** + * Verifies a NodePool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodePool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodePool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.NodePool; + + /** + * Creates a plain object from a NodePool message. Also converts values to other types if specified. + * @param message NodePool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.NodePool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodePool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodePool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Role. */ + interface IRole { + + /** Role kind */ + kind?: (google.cloud.securitycenter.v1.Kubernetes.Role.Kind|keyof typeof google.cloud.securitycenter.v1.Kubernetes.Role.Kind|null); + + /** Role ns */ + ns?: (string|null); + + /** Role name */ + name?: (string|null); + } + + /** Represents a Role. */ + class Role implements IRole { + + /** + * Constructs a new Role. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.IRole); + + /** Role kind. */ + public kind: (google.cloud.securitycenter.v1.Kubernetes.Role.Kind|keyof typeof google.cloud.securitycenter.v1.Kubernetes.Role.Kind); + + /** Role ns. */ + public ns: string; + + /** Role name. */ + public name: string; + + /** + * Creates a new Role instance using the specified properties. + * @param [properties] Properties to set + * @returns Role instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.IRole): google.cloud.securitycenter.v1.Kubernetes.Role; + + /** + * Encodes the specified Role message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Role.verify|verify} messages. + * @param message Role message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.IRole, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Role message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Role.verify|verify} messages. + * @param message Role message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.IRole, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Role message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Role + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Kubernetes.Role; + + /** + * Decodes a Role message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Role + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Kubernetes.Role; + + /** + * Verifies a Role message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Role message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Role + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.Role; + + /** + * Creates a plain object from a Role message. Also converts values to other types if specified. + * @param message Role + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.Role, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Role to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Role + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Role { + + /** Kind enum. */ + enum Kind { + KIND_UNSPECIFIED = 0, + ROLE = 1, + CLUSTER_ROLE = 2 + } + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding ns */ + ns?: (string|null); + + /** Binding name */ + name?: (string|null); + + /** Binding role */ + role?: (google.cloud.securitycenter.v1.Kubernetes.IRole|null); + + /** Binding subjects */ + subjects?: (google.cloud.securitycenter.v1.Kubernetes.ISubject[]|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.IBinding); + + /** Binding ns. */ + public ns: string; + + /** Binding name. */ + public name: string; + + /** Binding role. */ + public role?: (google.cloud.securitycenter.v1.Kubernetes.IRole|null); + + /** Binding subjects. */ + public subjects: google.cloud.securitycenter.v1.Kubernetes.ISubject[]; + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.IBinding): google.cloud.securitycenter.v1.Kubernetes.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Kubernetes.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Kubernetes.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Subject. */ + interface ISubject { + + /** Subject kind */ + kind?: (google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType|keyof typeof google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType|null); + + /** Subject ns */ + ns?: (string|null); + + /** Subject name */ + name?: (string|null); + } + + /** Represents a Subject. */ + class Subject implements ISubject { + + /** + * Constructs a new Subject. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.ISubject); + + /** Subject kind. */ + public kind: (google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType|keyof typeof google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType); + + /** Subject ns. */ + public ns: string; + + /** Subject name. */ + public name: string; + + /** + * Creates a new Subject instance using the specified properties. + * @param [properties] Properties to set + * @returns Subject instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.ISubject): google.cloud.securitycenter.v1.Kubernetes.Subject; + + /** + * Encodes the specified Subject message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Subject.verify|verify} messages. + * @param message Subject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Subject.verify|verify} messages. + * @param message Subject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Subject message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Subject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Kubernetes.Subject; + + /** + * Decodes a Subject message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Subject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Kubernetes.Subject; + + /** + * Verifies a Subject message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Subject message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Subject + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.Subject; + + /** + * Creates a plain object from a Subject message. Also converts values to other types if specified. + * @param message Subject + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.Subject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Subject to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Subject + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Subject { + + /** AuthType enum. */ + enum AuthType { + AUTH_TYPE_UNSPECIFIED = 0, + USER = 1, + SERVICEACCOUNT = 2, + GROUP = 3 + } + } + + /** Properties of an AccessReview. */ + interface IAccessReview { + + /** AccessReview group */ + group?: (string|null); + + /** AccessReview ns */ + ns?: (string|null); + + /** AccessReview name */ + name?: (string|null); + + /** AccessReview resource */ + resource?: (string|null); + + /** AccessReview subresource */ + subresource?: (string|null); + + /** AccessReview verb */ + verb?: (string|null); + + /** AccessReview version */ + version?: (string|null); + } + + /** Represents an AccessReview. */ + class AccessReview implements IAccessReview { + + /** + * Constructs a new AccessReview. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.Kubernetes.IAccessReview); + + /** AccessReview group. */ + public group: string; + + /** AccessReview ns. */ + public ns: string; + + /** AccessReview name. */ + public name: string; + + /** AccessReview resource. */ + public resource: string; + + /** AccessReview subresource. */ + public subresource: string; + + /** AccessReview verb. */ + public verb: string; + + /** AccessReview version. */ + public version: string; + + /** + * Creates a new AccessReview instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessReview instance + */ + public static create(properties?: google.cloud.securitycenter.v1.Kubernetes.IAccessReview): google.cloud.securitycenter.v1.Kubernetes.AccessReview; + + /** + * Encodes the specified AccessReview message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.AccessReview.verify|verify} messages. + * @param message AccessReview message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.Kubernetes.IAccessReview, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessReview message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.AccessReview.verify|verify} messages. + * @param message AccessReview message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.Kubernetes.IAccessReview, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessReview message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessReview + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Kubernetes.AccessReview; + + /** + * Decodes an AccessReview message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessReview + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Kubernetes.AccessReview; + + /** + * Verifies an AccessReview message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessReview message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessReview + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Kubernetes.AccessReview; + + /** + * Creates a plain object from an AccessReview message. Also converts values to other types if specified. + * @param message AccessReview + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Kubernetes.AccessReview, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessReview to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessReview + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a MitreAttack. */ + interface IMitreAttack { + + /** MitreAttack primaryTactic */ + primaryTactic?: (google.cloud.securitycenter.v1.MitreAttack.Tactic|keyof typeof google.cloud.securitycenter.v1.MitreAttack.Tactic|null); + + /** MitreAttack primaryTechniques */ + primaryTechniques?: (google.cloud.securitycenter.v1.MitreAttack.Technique[]|null); + + /** MitreAttack additionalTactics */ + additionalTactics?: (google.cloud.securitycenter.v1.MitreAttack.Tactic[]|null); + + /** MitreAttack additionalTechniques */ + additionalTechniques?: (google.cloud.securitycenter.v1.MitreAttack.Technique[]|null); + + /** MitreAttack version */ + version?: (string|null); + } + + /** Represents a MitreAttack. */ + class MitreAttack implements IMitreAttack { + + /** + * Constructs a new MitreAttack. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IMitreAttack); + + /** MitreAttack primaryTactic. */ + public primaryTactic: (google.cloud.securitycenter.v1.MitreAttack.Tactic|keyof typeof google.cloud.securitycenter.v1.MitreAttack.Tactic); + + /** MitreAttack primaryTechniques. */ + public primaryTechniques: google.cloud.securitycenter.v1.MitreAttack.Technique[]; + + /** MitreAttack additionalTactics. */ + public additionalTactics: google.cloud.securitycenter.v1.MitreAttack.Tactic[]; + + /** MitreAttack additionalTechniques. */ + public additionalTechniques: google.cloud.securitycenter.v1.MitreAttack.Technique[]; + + /** MitreAttack version. */ + public version: string; + + /** + * Creates a new MitreAttack instance using the specified properties. + * @param [properties] Properties to set + * @returns MitreAttack instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IMitreAttack): google.cloud.securitycenter.v1.MitreAttack; + + /** + * Encodes the specified MitreAttack message. Does not implicitly {@link google.cloud.securitycenter.v1.MitreAttack.verify|verify} messages. + * @param message MitreAttack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IMitreAttack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MitreAttack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.MitreAttack.verify|verify} messages. + * @param message MitreAttack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IMitreAttack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MitreAttack message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MitreAttack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.MitreAttack; + + /** + * Decodes a MitreAttack message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MitreAttack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.MitreAttack; + + /** + * Verifies a MitreAttack message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MitreAttack message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MitreAttack + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.MitreAttack; + + /** + * Creates a plain object from a MitreAttack message. Also converts values to other types if specified. + * @param message MitreAttack + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.MitreAttack, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MitreAttack to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MitreAttack + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MitreAttack { + + /** Tactic enum. */ + enum Tactic { + TACTIC_UNSPECIFIED = 0, + RECONNAISSANCE = 1, + RESOURCE_DEVELOPMENT = 2, + INITIAL_ACCESS = 5, + EXECUTION = 3, + PERSISTENCE = 6, + PRIVILEGE_ESCALATION = 8, + DEFENSE_EVASION = 7, + CREDENTIAL_ACCESS = 9, + DISCOVERY = 10, + LATERAL_MOVEMENT = 11, + COLLECTION = 12, + COMMAND_AND_CONTROL = 4, + EXFILTRATION = 13, + IMPACT = 14 + } + + /** Technique enum. */ + enum Technique { + TECHNIQUE_UNSPECIFIED = 0, + ACTIVE_SCANNING = 1, + SCANNING_IP_BLOCKS = 2, + INGRESS_TOOL_TRANSFER = 3, + NATIVE_API = 4, + SHARED_MODULES = 5, + COMMAND_AND_SCRIPTING_INTERPRETER = 6, + UNIX_SHELL = 7, + RESOURCE_HIJACKING = 8, + PROXY = 9, + EXTERNAL_PROXY = 10, + MULTI_HOP_PROXY = 11, + DYNAMIC_RESOLUTION = 12, + UNSECURED_CREDENTIALS = 13, + VALID_ACCOUNTS = 14, + LOCAL_ACCOUNTS = 15, + CLOUD_ACCOUNTS = 16, + NETWORK_DENIAL_OF_SERVICE = 17, + PERMISSION_GROUPS_DISCOVERY = 18, + CLOUD_GROUPS = 19, + EXFILTRATION_OVER_WEB_SERVICE = 20, + EXFILTRATION_TO_CLOUD_STORAGE = 21, + ACCOUNT_MANIPULATION = 22, + SSH_AUTHORIZED_KEYS = 23, + CREATE_OR_MODIFY_SYSTEM_PROCESS = 24, + STEAL_WEB_SESSION_COOKIE = 25, + MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26, + EXPLOIT_PUBLIC_FACING_APPLICATION = 27, + MODIFY_AUTHENTICATION_PROCESS = 28, + DATA_DESTRUCTION = 29, + DOMAIN_POLICY_MODIFICATION = 30, + IMPAIR_DEFENSES = 31, + NETWORK_SERVICE_DISCOVERY = 32, + ACCESS_TOKEN_MANIPULATION = 33, + ABUSE_ELEVATION_CONTROL_MECHANISM = 34, + DEFAULT_ACCOUNTS = 35 + } + } + + /** Properties of a Process. */ + interface IProcess { + + /** Process name */ + name?: (string|null); + + /** Process binary */ + binary?: (google.cloud.securitycenter.v1.IFile|null); + + /** Process libraries */ + libraries?: (google.cloud.securitycenter.v1.IFile[]|null); + + /** Process script */ + script?: (google.cloud.securitycenter.v1.IFile|null); + + /** Process args */ + args?: (string[]|null); + + /** Process argumentsTruncated */ + argumentsTruncated?: (boolean|null); + + /** Process envVariables */ + envVariables?: (google.cloud.securitycenter.v1.IEnvironmentVariable[]|null); + + /** Process envVariablesTruncated */ + envVariablesTruncated?: (boolean|null); + + /** Process pid */ + pid?: (number|Long|string|null); + + /** Process parentPid */ + parentPid?: (number|Long|string|null); + } + + /** Represents a Process. */ + class Process implements IProcess { + + /** + * Constructs a new Process. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IProcess); + + /** Process name. */ + public name: string; + + /** Process binary. */ + public binary?: (google.cloud.securitycenter.v1.IFile|null); + + /** Process libraries. */ + public libraries: google.cloud.securitycenter.v1.IFile[]; + + /** Process script. */ + public script?: (google.cloud.securitycenter.v1.IFile|null); + + /** Process args. */ + public args: string[]; + + /** Process argumentsTruncated. */ + public argumentsTruncated: boolean; + + /** Process envVariables. */ + public envVariables: google.cloud.securitycenter.v1.IEnvironmentVariable[]; + + /** Process envVariablesTruncated. */ + public envVariablesTruncated: boolean; + + /** Process pid. */ + public pid: (number|Long|string); + + /** Process parentPid. */ + public parentPid: (number|Long|string); + + /** + * Creates a new Process instance using the specified properties. + * @param [properties] Properties to set + * @returns Process instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IProcess): google.cloud.securitycenter.v1.Process; + + /** + * Encodes the specified Process message. Does not implicitly {@link google.cloud.securitycenter.v1.Process.verify|verify} messages. + * @param message Process message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IProcess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Process message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Process.verify|verify} messages. + * @param message Process message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IProcess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Process message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Process + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Process; + + /** + * Decodes a Process message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Process + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Process; + + /** + * Verifies a Process message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Process message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Process + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Process; + + /** + * Creates a plain object from a Process message. Also converts values to other types if specified. + * @param message Process + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Process, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Process to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Process + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnvironmentVariable. */ + interface IEnvironmentVariable { + + /** EnvironmentVariable name */ + name?: (string|null); + + /** EnvironmentVariable val */ + val?: (string|null); + } + + /** Represents an EnvironmentVariable. */ + class EnvironmentVariable implements IEnvironmentVariable { + + /** + * Constructs a new EnvironmentVariable. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IEnvironmentVariable); + + /** EnvironmentVariable name. */ + public name: string; + + /** EnvironmentVariable val. */ + public val: string; + + /** + * Creates a new EnvironmentVariable instance using the specified properties. + * @param [properties] Properties to set + * @returns EnvironmentVariable instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IEnvironmentVariable): google.cloud.securitycenter.v1.EnvironmentVariable; + + /** + * Encodes the specified EnvironmentVariable message. Does not implicitly {@link google.cloud.securitycenter.v1.EnvironmentVariable.verify|verify} messages. + * @param message EnvironmentVariable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IEnvironmentVariable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnvironmentVariable message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EnvironmentVariable.verify|verify} messages. + * @param message EnvironmentVariable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IEnvironmentVariable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnvironmentVariable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnvironmentVariable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.EnvironmentVariable; + + /** + * Decodes an EnvironmentVariable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnvironmentVariable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.EnvironmentVariable; + + /** + * Verifies an EnvironmentVariable message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnvironmentVariable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnvironmentVariable + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.EnvironmentVariable; + + /** + * Creates a plain object from an EnvironmentVariable message. Also converts values to other types if specified. + * @param message EnvironmentVariable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.EnvironmentVariable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnvironmentVariable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnvironmentVariable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Vulnerability. */ + interface IVulnerability { + + /** Vulnerability cve */ + cve?: (google.cloud.securitycenter.v1.ICve|null); + } + + /** Represents a Vulnerability. */ + class Vulnerability implements IVulnerability { + + /** + * Constructs a new Vulnerability. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IVulnerability); + + /** Vulnerability cve. */ + public cve?: (google.cloud.securitycenter.v1.ICve|null); + + /** + * Creates a new Vulnerability instance using the specified properties. + * @param [properties] Properties to set + * @returns Vulnerability instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IVulnerability): google.cloud.securitycenter.v1.Vulnerability; + + /** + * Encodes the specified Vulnerability message. Does not implicitly {@link google.cloud.securitycenter.v1.Vulnerability.verify|verify} messages. + * @param message Vulnerability message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IVulnerability, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vulnerability message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Vulnerability.verify|verify} messages. + * @param message Vulnerability message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IVulnerability, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Vulnerability message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Vulnerability + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Vulnerability; + + /** + * Decodes a Vulnerability message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Vulnerability + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Vulnerability; + + /** + * Verifies a Vulnerability message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Vulnerability message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Vulnerability + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Vulnerability; + + /** + * Creates a plain object from a Vulnerability message. Also converts values to other types if specified. + * @param message Vulnerability + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Vulnerability, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Vulnerability to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Vulnerability + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cve. */ + interface ICve { + + /** Cve id */ + id?: (string|null); + + /** Cve references */ + references?: (google.cloud.securitycenter.v1.IReference[]|null); + + /** Cve cvssv3 */ + cvssv3?: (google.cloud.securitycenter.v1.ICvssv3|null); + + /** Cve upstreamFixAvailable */ + upstreamFixAvailable?: (boolean|null); + } + + /** Represents a Cve. */ + class Cve implements ICve { + + /** + * Constructs a new Cve. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICve); + + /** Cve id. */ + public id: string; + + /** Cve references. */ + public references: google.cloud.securitycenter.v1.IReference[]; + + /** Cve cvssv3. */ + public cvssv3?: (google.cloud.securitycenter.v1.ICvssv3|null); + + /** Cve upstreamFixAvailable. */ + public upstreamFixAvailable: boolean; + + /** + * Creates a new Cve instance using the specified properties. + * @param [properties] Properties to set + * @returns Cve instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICve): google.cloud.securitycenter.v1.Cve; + + /** + * Encodes the specified Cve message. Does not implicitly {@link google.cloud.securitycenter.v1.Cve.verify|verify} messages. + * @param message Cve message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICve, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cve message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Cve.verify|verify} messages. + * @param message Cve message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICve, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cve message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cve + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Cve; + + /** + * Decodes a Cve message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cve + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Cve; + + /** + * Verifies a Cve message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cve message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cve + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Cve; + + /** + * Creates a plain object from a Cve message. Also converts values to other types if specified. + * @param message Cve + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Cve, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cve to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cve + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Reference. */ + interface IReference { + + /** Reference source */ + source?: (string|null); + + /** Reference uri */ + uri?: (string|null); + } + + /** Represents a Reference. */ + class Reference implements IReference { + + /** + * Constructs a new Reference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IReference); + + /** Reference source. */ + public source: string; + + /** Reference uri. */ + public uri: string; + + /** + * Creates a new Reference instance using the specified properties. + * @param [properties] Properties to set + * @returns Reference instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IReference): google.cloud.securitycenter.v1.Reference; + + /** + * Encodes the specified Reference message. Does not implicitly {@link google.cloud.securitycenter.v1.Reference.verify|verify} messages. + * @param message Reference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Reference message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Reference.verify|verify} messages. + * @param message Reference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Reference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Reference; + + /** + * Decodes a Reference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Reference; + + /** + * Verifies a Reference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Reference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Reference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Reference; + + /** + * Creates a plain object from a Reference message. Also converts values to other types if specified. + * @param message Reference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Reference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Reference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Reference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cvssv3. */ + interface ICvssv3 { + + /** Cvssv3 baseScore */ + baseScore?: (number|null); + + /** Cvssv3 attackVector */ + attackVector?: (google.cloud.securitycenter.v1.Cvssv3.AttackVector|keyof typeof google.cloud.securitycenter.v1.Cvssv3.AttackVector|null); + + /** Cvssv3 attackComplexity */ + attackComplexity?: (google.cloud.securitycenter.v1.Cvssv3.AttackComplexity|keyof typeof google.cloud.securitycenter.v1.Cvssv3.AttackComplexity|null); + + /** Cvssv3 privilegesRequired */ + privilegesRequired?: (google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired|keyof typeof google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired|null); + + /** Cvssv3 userInteraction */ + userInteraction?: (google.cloud.securitycenter.v1.Cvssv3.UserInteraction|keyof typeof google.cloud.securitycenter.v1.Cvssv3.UserInteraction|null); + + /** Cvssv3 scope */ + scope?: (google.cloud.securitycenter.v1.Cvssv3.Scope|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Scope|null); + + /** Cvssv3 confidentialityImpact */ + confidentialityImpact?: (google.cloud.securitycenter.v1.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Impact|null); + + /** Cvssv3 integrityImpact */ + integrityImpact?: (google.cloud.securitycenter.v1.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Impact|null); + + /** Cvssv3 availabilityImpact */ + availabilityImpact?: (google.cloud.securitycenter.v1.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Impact|null); + } + + /** Represents a Cvssv3. */ + class Cvssv3 implements ICvssv3 { + + /** + * Constructs a new Cvssv3. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICvssv3); + + /** Cvssv3 baseScore. */ + public baseScore: number; + + /** Cvssv3 attackVector. */ + public attackVector: (google.cloud.securitycenter.v1.Cvssv3.AttackVector|keyof typeof google.cloud.securitycenter.v1.Cvssv3.AttackVector); + + /** Cvssv3 attackComplexity. */ + public attackComplexity: (google.cloud.securitycenter.v1.Cvssv3.AttackComplexity|keyof typeof google.cloud.securitycenter.v1.Cvssv3.AttackComplexity); + + /** Cvssv3 privilegesRequired. */ + public privilegesRequired: (google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired|keyof typeof google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired); + + /** Cvssv3 userInteraction. */ + public userInteraction: (google.cloud.securitycenter.v1.Cvssv3.UserInteraction|keyof typeof google.cloud.securitycenter.v1.Cvssv3.UserInteraction); + + /** Cvssv3 scope. */ + public scope: (google.cloud.securitycenter.v1.Cvssv3.Scope|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Scope); + + /** Cvssv3 confidentialityImpact. */ + public confidentialityImpact: (google.cloud.securitycenter.v1.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Impact); + + /** Cvssv3 integrityImpact. */ + public integrityImpact: (google.cloud.securitycenter.v1.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Impact); + + /** Cvssv3 availabilityImpact. */ + public availabilityImpact: (google.cloud.securitycenter.v1.Cvssv3.Impact|keyof typeof google.cloud.securitycenter.v1.Cvssv3.Impact); + + /** + * Creates a new Cvssv3 instance using the specified properties. + * @param [properties] Properties to set + * @returns Cvssv3 instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICvssv3): google.cloud.securitycenter.v1.Cvssv3; + + /** + * Encodes the specified Cvssv3 message. Does not implicitly {@link google.cloud.securitycenter.v1.Cvssv3.verify|verify} messages. + * @param message Cvssv3 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICvssv3, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cvssv3 message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Cvssv3.verify|verify} messages. + * @param message Cvssv3 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICvssv3, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cvssv3 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cvssv3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Cvssv3; + + /** + * Decodes a Cvssv3 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cvssv3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Cvssv3; + + /** + * Verifies a Cvssv3 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cvssv3 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cvssv3 + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Cvssv3; + + /** + * Creates a plain object from a Cvssv3 message. Also converts values to other types if specified. + * @param message Cvssv3 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Cvssv3, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cvssv3 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cvssv3 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Cvssv3 { + + /** AttackVector enum. */ + enum AttackVector { + ATTACK_VECTOR_UNSPECIFIED = 0, + ATTACK_VECTOR_NETWORK = 1, + ATTACK_VECTOR_ADJACENT = 2, + ATTACK_VECTOR_LOCAL = 3, + ATTACK_VECTOR_PHYSICAL = 4 + } + + /** AttackComplexity enum. */ + enum AttackComplexity { + ATTACK_COMPLEXITY_UNSPECIFIED = 0, + ATTACK_COMPLEXITY_LOW = 1, + ATTACK_COMPLEXITY_HIGH = 2 + } + + /** PrivilegesRequired enum. */ + enum PrivilegesRequired { + PRIVILEGES_REQUIRED_UNSPECIFIED = 0, + PRIVILEGES_REQUIRED_NONE = 1, + PRIVILEGES_REQUIRED_LOW = 2, + PRIVILEGES_REQUIRED_HIGH = 3 + } + + /** UserInteraction enum. */ + enum UserInteraction { + USER_INTERACTION_UNSPECIFIED = 0, + USER_INTERACTION_NONE = 1, + USER_INTERACTION_REQUIRED = 2 + } + + /** Scope enum. */ + enum Scope { + SCOPE_UNSPECIFIED = 0, + SCOPE_UNCHANGED = 1, + SCOPE_CHANGED = 2 + } + + /** Impact enum. */ + enum Impact { + IMPACT_UNSPECIFIED = 0, + IMPACT_HIGH = 1, + IMPACT_LOW = 2, + IMPACT_NONE = 3 + } + } + + /** Properties of a MuteConfig. */ + interface IMuteConfig { + + /** MuteConfig name */ + name?: (string|null); + + /** MuteConfig displayName */ + displayName?: (string|null); + + /** MuteConfig description */ + description?: (string|null); + + /** MuteConfig filter */ + filter?: (string|null); + + /** MuteConfig createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** MuteConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** MuteConfig mostRecentEditor */ + mostRecentEditor?: (string|null); + } + + /** Represents a MuteConfig. */ + class MuteConfig implements IMuteConfig { + + /** + * Constructs a new MuteConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IMuteConfig); + + /** MuteConfig name. */ + public name: string; + + /** MuteConfig displayName. */ + public displayName: string; + + /** MuteConfig description. */ + public description: string; + + /** MuteConfig filter. */ + public filter: string; + + /** MuteConfig createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** MuteConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** MuteConfig mostRecentEditor. */ + public mostRecentEditor: string; + + /** + * Creates a new MuteConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MuteConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IMuteConfig): google.cloud.securitycenter.v1.MuteConfig; + + /** + * Encodes the specified MuteConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. + * @param message MuteConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IMuteConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MuteConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. + * @param message MuteConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IMuteConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MuteConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MuteConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.MuteConfig; + + /** + * Decodes a MuteConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MuteConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.MuteConfig; + + /** + * Verifies a MuteConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MuteConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MuteConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.MuteConfig; + + /** + * Creates a plain object from a MuteConfig message. Also converts values to other types if specified. + * @param message MuteConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.MuteConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MuteConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MuteConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NotificationConfig. */ + interface INotificationConfig { + + /** NotificationConfig name */ + name?: (string|null); + + /** NotificationConfig description */ + description?: (string|null); + + /** NotificationConfig pubsubTopic */ + pubsubTopic?: (string|null); + + /** NotificationConfig serviceAccount */ + serviceAccount?: (string|null); + + /** NotificationConfig streamingConfig */ + streamingConfig?: (google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null); + } + + /** Represents a NotificationConfig. */ + class NotificationConfig implements INotificationConfig { + + /** + * Constructs a new NotificationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.INotificationConfig); + + /** NotificationConfig name. */ + public name: string; + + /** NotificationConfig description. */ + public description: string; + + /** NotificationConfig pubsubTopic. */ + public pubsubTopic: string; + + /** NotificationConfig serviceAccount. */ + public serviceAccount: string; + + /** NotificationConfig streamingConfig. */ + public streamingConfig?: (google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null); + + /** NotificationConfig notifyConfig. */ + public notifyConfig?: "streamingConfig"; + + /** + * Creates a new NotificationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1.INotificationConfig): google.cloud.securitycenter.v1.NotificationConfig; + + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.NotificationConfig; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.NotificationConfig; + + /** + * Verifies a NotificationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.NotificationConfig; + + /** + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @param message NotificationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.NotificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NotificationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NotificationConfig { + + /** Properties of a StreamingConfig. */ + interface IStreamingConfig { + + /** StreamingConfig filter */ + filter?: (string|null); + } + + /** Represents a StreamingConfig. */ + class StreamingConfig implements IStreamingConfig { + + /** + * Constructs a new StreamingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig); + + /** StreamingConfig filter. */ + public filter: string; + + /** + * Creates a new StreamingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig): google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig; + + /** + * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @param message StreamingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @param message StreamingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig; + + /** + * Verifies a StreamingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig; + + /** + * Creates a plain object from a StreamingConfig message. Also converts values to other types if specified. + * @param message StreamingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a NotificationMessage. */ + interface INotificationMessage { + + /** NotificationMessage notificationConfigName */ + notificationConfigName?: (string|null); + + /** NotificationMessage finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** NotificationMessage resource */ + resource?: (google.cloud.securitycenter.v1.IResource|null); + } + + /** Represents a NotificationMessage. */ + class NotificationMessage implements INotificationMessage { + + /** + * Constructs a new NotificationMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.INotificationMessage); + + /** NotificationMessage notificationConfigName. */ + public notificationConfigName: string; + + /** NotificationMessage finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** NotificationMessage resource. */ + public resource?: (google.cloud.securitycenter.v1.IResource|null); + + /** NotificationMessage event. */ + public event?: "finding"; + + /** + * Creates a new NotificationMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationMessage instance + */ + public static create(properties?: google.cloud.securitycenter.v1.INotificationMessage): google.cloud.securitycenter.v1.NotificationMessage; + + /** + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. + * @param message NotificationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.INotificationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. + * @param message NotificationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.INotificationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.NotificationMessage; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.NotificationMessage; + + /** + * Verifies a NotificationMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.NotificationMessage; + + /** + * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. + * @param message NotificationMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.NotificationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NotificationMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource name */ + name?: (string|null); + + /** Resource displayName */ + displayName?: (string|null); + + /** Resource type */ + type?: (string|null); + + /** Resource project */ + project?: (string|null); + + /** Resource projectDisplayName */ + projectDisplayName?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource parentDisplayName */ + parentDisplayName?: (string|null); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1.IFolder[]|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IResource); + + /** Resource name. */ + public name: string; + + /** Resource displayName. */ + public displayName: string; + + /** Resource type. */ + public type: string; + + /** Resource project. */ + public project: string; + + /** Resource projectDisplayName. */ + public projectDisplayName: string; + + /** Resource parent. */ + public parent: string; + + /** Resource parentDisplayName. */ + public parentDisplayName: string; + + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1.IFolder[]; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IResource): google.cloud.securitycenter.v1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Resource; + + /** + * Verifies a Resource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OrganizationSettings. */ + interface IOrganizationSettings { + + /** OrganizationSettings name */ + name?: (string|null); + + /** OrganizationSettings enableAssetDiscovery */ + enableAssetDiscovery?: (boolean|null); + + /** OrganizationSettings assetDiscoveryConfig */ + assetDiscoveryConfig?: (google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null); + } + + /** Represents an OrganizationSettings. */ + class OrganizationSettings implements IOrganizationSettings { + + /** + * Constructs a new OrganizationSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IOrganizationSettings); + + /** OrganizationSettings name. */ + public name: string; + + /** OrganizationSettings enableAssetDiscovery. */ + public enableAssetDiscovery: boolean; + + /** OrganizationSettings assetDiscoveryConfig. */ + public assetDiscoveryConfig?: (google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null); + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns OrganizationSettings instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IOrganizationSettings): google.cloud.securitycenter.v1.OrganizationSettings; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.OrganizationSettings; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.OrganizationSettings; + + /** + * Verifies an OrganizationSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrganizationSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrganizationSettings; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @param message OrganizationSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.OrganizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrganizationSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrganizationSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OrganizationSettings { + + /** Properties of an AssetDiscoveryConfig. */ + interface IAssetDiscoveryConfig { + + /** AssetDiscoveryConfig projectIds */ + projectIds?: (string[]|null); + + /** AssetDiscoveryConfig inclusionMode */ + inclusionMode?: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + + /** AssetDiscoveryConfig folderIds */ + folderIds?: (string[]|null); + } + + /** Represents an AssetDiscoveryConfig. */ + class AssetDiscoveryConfig implements IAssetDiscoveryConfig { + + /** + * Constructs a new AssetDiscoveryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig); + + /** AssetDiscoveryConfig projectIds. */ + public projectIds: string[]; + + /** AssetDiscoveryConfig inclusionMode. */ + public inclusionMode: (google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode); + + /** AssetDiscoveryConfig folderIds. */ + public folderIds: string[]; + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AssetDiscoveryConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Verifies an AssetDiscoveryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssetDiscoveryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @param message AssetDiscoveryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AssetDiscoveryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AssetDiscoveryConfig { + + /** InclusionMode enum. */ + enum InclusionMode { + INCLUSION_MODE_UNSPECIFIED = 0, + INCLUDE_ONLY = 1, + EXCLUDE = 2 + } + } + } + + /** Properties of a RunAssetDiscoveryResponse. */ + interface IRunAssetDiscoveryResponse { + + /** RunAssetDiscoveryResponse state */ + state?: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null); + + /** RunAssetDiscoveryResponse duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a RunAssetDiscoveryResponse. */ + class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse); + + /** RunAssetDiscoveryResponse state. */ + public state: (google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State); + + /** RunAssetDiscoveryResponse duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Verifies a RunAssetDiscoveryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.RunAssetDiscoveryResponse; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAssetDiscoveryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RunAssetDiscoveryResponse { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + COMPLETED = 1, + SUPERSEDED = 2, + TERMINATED = 3 + } + } + + /** Represents a SecurityCenter */ + class SecurityCenter extends $protobuf.rpc.Service { + + /** + * Constructs a new SecurityCenter 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 SecurityCenter 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): SecurityCenter; + + /** + * Calls BulkMuteFindings. + * @param request BulkMuteFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public bulkMuteFindings(request: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindingsCallback): void; + + /** + * Calls BulkMuteFindings. + * @param request BulkMuteFindingsRequest message or plain object + * @returns Promise + */ + public bulkMuteFindings(request: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest): Promise; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback): void; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @returns Promise + */ + public createSource(request: google.cloud.securitycenter.v1.ICreateSourceRequest): Promise; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback): void; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @returns Promise + */ + public createFinding(request: google.cloud.securitycenter.v1.ICreateFindingRequest): Promise; + + /** + * Calls CreateMuteConfig. + * @param request CreateMuteConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MuteConfig + */ + public createMuteConfig(request: google.cloud.securitycenter.v1.ICreateMuteConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfigCallback): void; + + /** + * Calls CreateMuteConfig. + * @param request CreateMuteConfigRequest message or plain object + * @returns Promise + */ + public createMuteConfig(request: google.cloud.securitycenter.v1.ICreateMuteConfigRequest): Promise; + + /** + * Calls CreateNotificationConfig. + * @param request CreateNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationConfig + */ + public createNotificationConfig(request: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfigCallback): void; + + /** + * Calls CreateNotificationConfig. + * @param request CreateNotificationConfigRequest message or plain object + * @returns Promise + */ + public createNotificationConfig(request: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest): Promise; + + /** + * Calls DeleteMuteConfig. + * @param request DeleteMuteConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteMuteConfig(request: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfigCallback): void; + + /** + * Calls DeleteMuteConfig. + * @param request DeleteMuteConfigRequest message or plain object + * @returns Promise + */ + public deleteMuteConfig(request: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest): Promise; + + /** + * Calls DeleteNotificationConfig. + * @param request DeleteNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteNotificationConfig(request: google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfigCallback): void; + + /** + * Calls DeleteNotificationConfig. + * @param request DeleteNotificationConfigRequest message or plain object + * @returns Promise + */ + public deleteNotificationConfig(request: google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest): Promise; + + /** + * Calls GetBigQueryExport. + * @param request GetBigQueryExportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BigQueryExport + */ + public getBigQueryExport(request: google.cloud.securitycenter.v1.IGetBigQueryExportRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExportCallback): void; + + /** + * Calls GetBigQueryExport. + * @param request GetBigQueryExportRequest message or plain object + * @returns Promise + */ + public getBigQueryExport(request: google.cloud.securitycenter.v1.IGetBigQueryExportRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls GetMuteConfig. + * @param request GetMuteConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MuteConfig + */ + public getMuteConfig(request: google.cloud.securitycenter.v1.IGetMuteConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfigCallback): void; + + /** + * Calls GetMuteConfig. + * @param request GetMuteConfigRequest message or plain object + * @returns Promise + */ + public getMuteConfig(request: google.cloud.securitycenter.v1.IGetMuteConfigRequest): Promise; + + /** + * Calls GetNotificationConfig. + * @param request GetNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationConfig + */ + public getNotificationConfig(request: google.cloud.securitycenter.v1.IGetNotificationConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfigCallback): void; + + /** + * Calls GetNotificationConfig. + * @param request GetNotificationConfigRequest message or plain object + * @returns Promise + */ + public getNotificationConfig(request: google.cloud.securitycenter.v1.IGetNotificationConfigRequest): Promise; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback): void; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest): Promise; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public getSource(request: google.cloud.securitycenter.v1.IGetSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback): void; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @returns Promise + */ + public getSource(request: google.cloud.securitycenter.v1.IGetSourceRequest): Promise; + + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupAssetsResponse + */ + public groupAssets(request: google.cloud.securitycenter.v1.IGroupAssetsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback): void; + + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @returns Promise + */ + public groupAssets(request: google.cloud.securitycenter.v1.IGroupAssetsRequest): Promise; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupFindingsResponse + */ + public groupFindings(request: google.cloud.securitycenter.v1.IGroupFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback): void; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @returns Promise + */ + public groupFindings(request: google.cloud.securitycenter.v1.IGroupFindingsRequest): Promise; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + */ + public listAssets(request: google.cloud.securitycenter.v1.IListAssetsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback): void; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise + */ + public listAssets(request: google.cloud.securitycenter.v1.IListAssetsRequest): 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.securitycenter.v1.IListFindingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback): void; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @returns Promise + */ + public listFindings(request: google.cloud.securitycenter.v1.IListFindingsRequest): Promise; + + /** + * Calls ListMuteConfigs. + * @param request ListMuteConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMuteConfigsResponse + */ + public listMuteConfigs(request: google.cloud.securitycenter.v1.IListMuteConfigsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigsCallback): void; + + /** + * Calls ListMuteConfigs. + * @param request ListMuteConfigsRequest message or plain object + * @returns Promise + */ + public listMuteConfigs(request: google.cloud.securitycenter.v1.IListMuteConfigsRequest): Promise; + + /** + * Calls ListNotificationConfigs. + * @param request ListNotificationConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListNotificationConfigsResponse + */ + public listNotificationConfigs(request: google.cloud.securitycenter.v1.IListNotificationConfigsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigsCallback): void; + + /** + * Calls ListNotificationConfigs. + * @param request ListNotificationConfigsRequest message or plain object + * @returns Promise + */ + public listNotificationConfigs(request: google.cloud.securitycenter.v1.IListNotificationConfigsRequest): Promise; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSourcesResponse + */ + public listSources(request: google.cloud.securitycenter.v1.IListSourcesRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback): void; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @returns Promise + */ + public listSources(request: google.cloud.securitycenter.v1.IListSourcesRequest): Promise; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback): void; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @returns Promise + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest): Promise; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback): void; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @returns Promise + */ + public setFindingState(request: google.cloud.securitycenter.v1.ISetFindingStateRequest): Promise; + + /** + * Calls SetMute. + * @param request SetMuteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public setMute(request: google.cloud.securitycenter.v1.ISetMuteRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetMuteCallback): void; + + /** + * Calls SetMute. + * @param request SetMuteRequest message or plain object + * @returns Promise + */ + public setMute(request: google.cloud.securitycenter.v1.ISetMuteRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls UpdateExternalSystem. + * @param request UpdateExternalSystemRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExternalSystem + */ + public updateExternalSystem(request: google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystemCallback): void; + + /** + * Calls UpdateExternalSystem. + * @param request UpdateExternalSystemRequest message or plain object + * @returns Promise + */ + public updateExternalSystem(request: google.cloud.securitycenter.v1.IUpdateExternalSystemRequest): Promise; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback): void; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @returns Promise + */ + public updateFinding(request: google.cloud.securitycenter.v1.IUpdateFindingRequest): Promise; + + /** + * Calls UpdateMuteConfig. + * @param request UpdateMuteConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MuteConfig + */ + public updateMuteConfig(request: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfigCallback): void; + + /** + * Calls UpdateMuteConfig. + * @param request UpdateMuteConfigRequest message or plain object + * @returns Promise + */ + public updateMuteConfig(request: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest): Promise; + + /** + * Calls UpdateNotificationConfig. + * @param request UpdateNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationConfig + */ + public updateNotificationConfig(request: google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfigCallback): void; + + /** + * Calls UpdateNotificationConfig. + * @param request UpdateNotificationConfigRequest message or plain object + * @returns Promise + */ + public updateNotificationConfig(request: google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest): Promise; + + /** + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings + */ + public updateOrganizationSettings(request: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback): void; + + /** + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public updateOrganizationSettings(request: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest): Promise; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public updateSource(request: google.cloud.securitycenter.v1.IUpdateSourceRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback): void; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @returns Promise + */ + public updateSource(request: google.cloud.securitycenter.v1.IUpdateSourceRequest): Promise; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityMarks + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback): void; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @returns Promise + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest): Promise; + + /** + * Calls CreateBigQueryExport. + * @param request CreateBigQueryExportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BigQueryExport + */ + public createBigQueryExport(request: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExportCallback): void; + + /** + * Calls CreateBigQueryExport. + * @param request CreateBigQueryExportRequest message or plain object + * @returns Promise + */ + public createBigQueryExport(request: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest): Promise; + + /** + * Calls DeleteBigQueryExport. + * @param request DeleteBigQueryExportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBigQueryExport(request: google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExportCallback): void; + + /** + * Calls DeleteBigQueryExport. + * @param request DeleteBigQueryExportRequest message or plain object + * @returns Promise + */ + public deleteBigQueryExport(request: google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest): Promise; + + /** + * Calls UpdateBigQueryExport. + * @param request UpdateBigQueryExportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BigQueryExport + */ + public updateBigQueryExport(request: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExportCallback): void; + + /** + * Calls UpdateBigQueryExport. + * @param request UpdateBigQueryExportRequest message or plain object + * @returns Promise + */ + public updateBigQueryExport(request: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest): Promise; + + /** + * Calls ListBigQueryExports. + * @param request ListBigQueryExportsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBigQueryExportsResponse + */ + public listBigQueryExports(request: google.cloud.securitycenter.v1.IListBigQueryExportsRequest, callback: google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExportsCallback): void; + + /** + * Calls ListBigQueryExports. + * @param request ListBigQueryExportsRequest message or plain object + * @returns Promise + */ + public listBigQueryExports(request: google.cloud.securitycenter.v1.IListBigQueryExportsRequest): Promise; + } + + namespace SecurityCenter { + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|bulkMuteFindings}. + * @param error Error, if any + * @param [response] Operation + */ + type BulkMuteFindingsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createSource}. + * @param error Error, if any + * @param [response] Source + */ + type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createMuteConfig}. + * @param error Error, if any + * @param [response] MuteConfig + */ + type CreateMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.MuteConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type CreateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteMuteConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteMuteConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteNotificationConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteNotificationConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getBigQueryExport}. + * @param error Error, if any + * @param [response] BigQueryExport + */ + type GetBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.BigQueryExport) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getMuteConfig}. + * @param error Error, if any + * @param [response] MuteConfig + */ + type GetMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.MuteConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type GetNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getSource}. + * @param error Error, if any + * @param [response] Source + */ + type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|groupAssets}. + * @param error Error, if any + * @param [response] GroupAssetsResponse + */ + type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|groupFindings}. + * @param error Error, if any + * @param [response] GroupFindingsResponse + */ + type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.GroupFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse + */ + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listFindings}. + * @param error Error, if any + * @param [response] ListFindingsResponse + */ + type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listMuteConfigs}. + * @param error Error, if any + * @param [response] ListMuteConfigsResponse + */ + type ListMuteConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListMuteConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listNotificationConfigs}. + * @param error Error, if any + * @param [response] ListNotificationConfigsResponse + */ + type ListNotificationConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListNotificationConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listSources}. + * @param error Error, if any + * @param [response] ListSourcesResponse + */ + type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|runAssetDiscovery}. + * @param error Error, if any + * @param [response] Operation + */ + type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|setFindingState}. + * @param error Error, if any + * @param [response] Finding + */ + type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|setMute}. + * @param error Error, if any + * @param [response] Finding + */ + type SetMuteCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateExternalSystem}. + * @param error Error, if any + * @param [response] ExternalSystem + */ + type UpdateExternalSystemCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ExternalSystem) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateMuteConfig}. + * @param error Error, if any + * @param [response] MuteConfig + */ + type UpdateMuteConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.MuteConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type UpdateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateSource}. + * @param error Error, if any + * @param [response] Source + */ + type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateSecurityMarks}. + * @param error Error, if any + * @param [response] SecurityMarks + */ + type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.SecurityMarks) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createBigQueryExport}. + * @param error Error, if any + * @param [response] BigQueryExport + */ + type CreateBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.BigQueryExport) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteBigQueryExport}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBigQueryExportCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateBigQueryExport}. + * @param error Error, if any + * @param [response] BigQueryExport + */ + type UpdateBigQueryExportCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.BigQueryExport) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listBigQueryExports}. + * @param error Error, if any + * @param [response] ListBigQueryExportsResponse + */ + type ListBigQueryExportsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1.ListBigQueryExportsResponse) => void; + } + + /** Properties of a BulkMuteFindingsRequest. */ + interface IBulkMuteFindingsRequest { + + /** BulkMuteFindingsRequest parent */ + parent?: (string|null); + + /** BulkMuteFindingsRequest filter */ + filter?: (string|null); + + /** BulkMuteFindingsRequest muteAnnotation */ + muteAnnotation?: (string|null); + } + + /** Represents a BulkMuteFindingsRequest. */ + class BulkMuteFindingsRequest implements IBulkMuteFindingsRequest { + + /** + * Constructs a new BulkMuteFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest); + + /** BulkMuteFindingsRequest parent. */ + public parent: string; + + /** BulkMuteFindingsRequest filter. */ + public filter: string; + + /** BulkMuteFindingsRequest muteAnnotation. */ + public muteAnnotation: string; + + /** + * Creates a new BulkMuteFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BulkMuteFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest): google.cloud.securitycenter.v1.BulkMuteFindingsRequest; + + /** + * Encodes the specified BulkMuteFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. + * @param message BulkMuteFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkMuteFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. + * @param message BulkMuteFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BulkMuteFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BulkMuteFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.BulkMuteFindingsRequest; + + /** + * Decodes a BulkMuteFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BulkMuteFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.BulkMuteFindingsRequest; + + /** + * Verifies a BulkMuteFindingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BulkMuteFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BulkMuteFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BulkMuteFindingsRequest; + + /** + * Creates a plain object from a BulkMuteFindingsRequest message. Also converts values to other types if specified. + * @param message BulkMuteFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.BulkMuteFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BulkMuteFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BulkMuteFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BulkMuteFindingsResponse. */ + interface IBulkMuteFindingsResponse { + } + + /** Represents a BulkMuteFindingsResponse. */ + class BulkMuteFindingsResponse implements IBulkMuteFindingsResponse { + + /** + * Constructs a new BulkMuteFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IBulkMuteFindingsResponse); + + /** + * Creates a new BulkMuteFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BulkMuteFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IBulkMuteFindingsResponse): google.cloud.securitycenter.v1.BulkMuteFindingsResponse; + + /** + * Encodes the specified BulkMuteFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsResponse.verify|verify} messages. + * @param message BulkMuteFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkMuteFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsResponse.verify|verify} messages. + * @param message BulkMuteFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BulkMuteFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.BulkMuteFindingsResponse; + + /** + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BulkMuteFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.BulkMuteFindingsResponse; + + /** + * Verifies a BulkMuteFindingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BulkMuteFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BulkMuteFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.BulkMuteFindingsResponse; + + /** + * Creates a plain object from a BulkMuteFindingsResponse message. Also converts values to other types if specified. + * @param message BulkMuteFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.BulkMuteFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BulkMuteFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BulkMuteFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateFindingRequest. */ + interface ICreateFindingRequest { + + /** CreateFindingRequest parent */ + parent?: (string|null); + + /** CreateFindingRequest findingId */ + findingId?: (string|null); + + /** CreateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); + } + + /** Represents a CreateFindingRequest. */ + class CreateFindingRequest implements ICreateFindingRequest { + + /** + * Constructs a new CreateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICreateFindingRequest); + + /** CreateFindingRequest parent. */ + public parent: string; + + /** CreateFindingRequest findingId. */ + public findingId: string; + + /** CreateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFindingRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateFindingRequest): google.cloud.securitycenter.v1.CreateFindingRequest; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.CreateFindingRequest; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.CreateFindingRequest; + + /** + * Verifies a CreateFindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateFindingRequest; + + /** + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @param message CreateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMuteConfigRequest. */ + interface ICreateMuteConfigRequest { + + /** CreateMuteConfigRequest parent */ + parent?: (string|null); + + /** CreateMuteConfigRequest muteConfig */ + muteConfig?: (google.cloud.securitycenter.v1.IMuteConfig|null); + + /** CreateMuteConfigRequest muteConfigId */ + muteConfigId?: (string|null); + } + + /** Represents a CreateMuteConfigRequest. */ + class CreateMuteConfigRequest implements ICreateMuteConfigRequest { + + /** + * Constructs a new CreateMuteConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICreateMuteConfigRequest); + + /** CreateMuteConfigRequest parent. */ + public parent: string; + + /** CreateMuteConfigRequest muteConfig. */ + public muteConfig?: (google.cloud.securitycenter.v1.IMuteConfig|null); + + /** CreateMuteConfigRequest muteConfigId. */ + public muteConfigId: string; + + /** + * Creates a new CreateMuteConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMuteConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateMuteConfigRequest): google.cloud.securitycenter.v1.CreateMuteConfigRequest; + + /** + * Encodes the specified CreateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateMuteConfigRequest.verify|verify} messages. + * @param message CreateMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICreateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateMuteConfigRequest.verify|verify} messages. + * @param message CreateMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.CreateMuteConfigRequest; + + /** + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.CreateMuteConfigRequest; + + /** + * Verifies a CreateMuteConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMuteConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateMuteConfigRequest; + + /** + * Creates a plain object from a CreateMuteConfigRequest message. Also converts values to other types if specified. + * @param message CreateMuteConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CreateMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMuteConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMuteConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateNotificationConfigRequest. */ + interface ICreateNotificationConfigRequest { + + /** CreateNotificationConfigRequest parent */ + parent?: (string|null); + + /** CreateNotificationConfigRequest configId */ + configId?: (string|null); + + /** CreateNotificationConfigRequest notificationConfig */ + notificationConfig?: (google.cloud.securitycenter.v1.INotificationConfig|null); + } + + /** Represents a CreateNotificationConfigRequest. */ + class CreateNotificationConfigRequest implements ICreateNotificationConfigRequest { + + /** + * Constructs a new CreateNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest); + + /** CreateNotificationConfigRequest parent. */ + public parent: string; + + /** CreateNotificationConfigRequest configId. */ + public configId: string; + + /** CreateNotificationConfigRequest notificationConfig. */ + public notificationConfig?: (google.cloud.securitycenter.v1.INotificationConfig|null); + + /** + * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest): google.cloud.securitycenter.v1.CreateNotificationConfigRequest; + + /** + * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * @param message CreateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * @param message CreateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.CreateNotificationConfigRequest; + + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.CreateNotificationConfigRequest; + + /** + * Verifies a CreateNotificationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateNotificationConfigRequest; + + /** + * Creates a plain object from a CreateNotificationConfigRequest message. Also converts values to other types if specified. + * @param message CreateNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CreateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSourceRequest. */ + interface ICreateSourceRequest { + + /** CreateSourceRequest parent */ + parent?: (string|null); + + /** CreateSourceRequest source */ + source?: (google.cloud.securitycenter.v1.ISource|null); + } + + /** Represents a CreateSourceRequest. */ + class CreateSourceRequest implements ICreateSourceRequest { + + /** + * Constructs a new CreateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICreateSourceRequest); + + /** CreateSourceRequest parent. */ + public parent: string; + + /** CreateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1.ISource|null); + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateSourceRequest): google.cloud.securitycenter.v1.CreateSourceRequest; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.CreateSourceRequest; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.CreateSourceRequest; + + /** + * Verifies a CreateSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateSourceRequest; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @param message CreateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteMuteConfigRequest. */ + interface IDeleteMuteConfigRequest { + + /** DeleteMuteConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteMuteConfigRequest. */ + class DeleteMuteConfigRequest implements IDeleteMuteConfigRequest { + + /** + * Constructs a new DeleteMuteConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest); + + /** DeleteMuteConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteMuteConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMuteConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest): google.cloud.securitycenter.v1.DeleteMuteConfigRequest; + + /** + * Encodes the specified DeleteMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteMuteConfigRequest.verify|verify} messages. + * @param message DeleteMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteMuteConfigRequest.verify|verify} messages. + * @param message DeleteMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.DeleteMuteConfigRequest; + + /** + * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.DeleteMuteConfigRequest; + + /** + * Verifies a DeleteMuteConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMuteConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteMuteConfigRequest; + + /** + * Creates a plain object from a DeleteMuteConfigRequest message. Also converts values to other types if specified. + * @param message DeleteMuteConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.DeleteMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMuteConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMuteConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteNotificationConfigRequest. */ + interface IDeleteNotificationConfigRequest { + + /** DeleteNotificationConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteNotificationConfigRequest. */ + class DeleteNotificationConfigRequest implements IDeleteNotificationConfigRequest { + + /** + * Constructs a new DeleteNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest); + + /** DeleteNotificationConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; + + /** + * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. + * @param message DeleteNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. + * @param message DeleteNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; + + /** + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; + + /** + * Verifies a DeleteNotificationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteNotificationConfigRequest; + + /** + * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. + * @param message DeleteNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.DeleteNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBigQueryExportRequest. */ + interface IGetBigQueryExportRequest { + + /** GetBigQueryExportRequest name */ + name?: (string|null); + } + + /** Represents a GetBigQueryExportRequest. */ + class GetBigQueryExportRequest implements IGetBigQueryExportRequest { + + /** + * Constructs a new GetBigQueryExportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetBigQueryExportRequest); + + /** GetBigQueryExportRequest name. */ + public name: string; + + /** + * Creates a new GetBigQueryExportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBigQueryExportRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetBigQueryExportRequest): google.cloud.securitycenter.v1.GetBigQueryExportRequest; + + /** + * Encodes the specified GetBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetBigQueryExportRequest.verify|verify} messages. + * @param message GetBigQueryExportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetBigQueryExportRequest.verify|verify} messages. + * @param message GetBigQueryExportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBigQueryExportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GetBigQueryExportRequest; + + /** + * Decodes a GetBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GetBigQueryExportRequest; + + /** + * Verifies a GetBigQueryExportRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBigQueryExportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetBigQueryExportRequest; + + /** + * Creates a plain object from a GetBigQueryExportRequest message. Also converts values to other types if specified. + * @param message GetBigQueryExportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBigQueryExportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBigQueryExportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMuteConfigRequest. */ + interface IGetMuteConfigRequest { + + /** GetMuteConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetMuteConfigRequest. */ + class GetMuteConfigRequest implements IGetMuteConfigRequest { + + /** + * Constructs a new GetMuteConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetMuteConfigRequest); + + /** GetMuteConfigRequest name. */ + public name: string; + + /** + * Creates a new GetMuteConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMuteConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetMuteConfigRequest): google.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. + * @param message GetMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. + * @param message GetMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMuteConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Decodes a GetMuteConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Verifies a GetMuteConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMuteConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetMuteConfigRequest; + + /** + * Creates a plain object from a GetMuteConfigRequest message. Also converts values to other types if specified. + * @param message GetMuteConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMuteConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMuteConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetNotificationConfigRequest. */ + interface IGetNotificationConfigRequest { + + /** GetNotificationConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetNotificationConfigRequest. */ + class GetNotificationConfigRequest implements IGetNotificationConfigRequest { + + /** + * Constructs a new GetNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetNotificationConfigRequest); + + /** GetNotificationConfigRequest name. */ + public name: string; + + /** + * Creates a new GetNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetNotificationConfigRequest): google.cloud.securitycenter.v1.GetNotificationConfigRequest; + + /** + * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. + * @param message GetNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. + * @param message GetNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GetNotificationConfigRequest; + + /** + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GetNotificationConfigRequest; + + /** + * Verifies a GetNotificationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetNotificationConfigRequest; + + /** + * Creates a plain object from a GetNotificationConfigRequest message. Also converts values to other types if specified. + * @param message GetNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOrganizationSettingsRequest. */ + interface IGetOrganizationSettingsRequest { + + /** GetOrganizationSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetOrganizationSettingsRequest. */ + class GetOrganizationSettingsRequest implements IGetOrganizationSettingsRequest { + + /** + * Constructs a new GetOrganizationSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest); + + /** GetOrganizationSettingsRequest name. */ + public name: string; + + /** + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOrganizationSettingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest): google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; + + /** + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; + + /** + * Verifies a GetOrganizationSettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOrganizationSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; + + /** + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message GetOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOrganizationSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOrganizationSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSourceRequest. */ + interface IGetSourceRequest { + + /** GetSourceRequest name */ + name?: (string|null); + } + + /** Represents a GetSourceRequest. */ + class GetSourceRequest implements IGetSourceRequest { + + /** + * Constructs a new GetSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGetSourceRequest); + + /** GetSourceRequest name. */ + public name: string; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGetSourceRequest): google.cloud.securitycenter.v1.GetSourceRequest; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GetSourceRequest; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GetSourceRequest; + + /** + * Verifies a GetSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GetSourceRequest; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @param message GetSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GetSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupAssetsRequest. */ + interface IGroupAssetsRequest { + + /** GroupAssetsRequest parent */ + parent?: (string|null); + + /** GroupAssetsRequest filter */ + filter?: (string|null); + + /** GroupAssetsRequest groupBy */ + groupBy?: (string|null); + + /** GroupAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest pageToken */ + pageToken?: (string|null); + + /** GroupAssetsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a GroupAssetsRequest. */ + class GroupAssetsRequest implements IGroupAssetsRequest { + + /** + * Constructs a new GroupAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupAssetsRequest); + + /** GroupAssetsRequest parent. */ + public parent: string; + + /** GroupAssetsRequest filter. */ + public filter: string; + + /** GroupAssetsRequest groupBy. */ + public groupBy: string; + + /** GroupAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest pageToken. */ + public pageToken: string; + + /** GroupAssetsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupAssetsRequest): google.cloud.securitycenter.v1.GroupAssetsRequest; + + /** + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupAssetsRequest; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupAssetsRequest; + + /** + * Verifies a GroupAssetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupAssetsRequest; + + /** + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * @param message GroupAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupAssetsResponse. */ + interface IGroupAssetsResponse { + + /** GroupAssetsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1.IGroupResult[]|null); + + /** GroupAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** GroupAssetsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a GroupAssetsResponse. */ + class GroupAssetsResponse implements IGroupAssetsResponse { + + /** + * Constructs a new GroupAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupAssetsResponse); + + /** GroupAssetsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1.IGroupResult[]; + + /** GroupAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** GroupAssetsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupAssetsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupAssetsResponse): google.cloud.securitycenter.v1.GroupAssetsResponse; + + /** + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupAssetsResponse; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupAssetsResponse; + + /** + * Verifies a GroupAssetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupAssetsResponse; + + /** + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @param message GroupAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupFindingsRequest. */ + interface IGroupFindingsRequest { + + /** GroupFindingsRequest parent */ + parent?: (string|null); + + /** GroupFindingsRequest filter */ + filter?: (string|null); + + /** GroupFindingsRequest groupBy */ + groupBy?: (string|null); + + /** GroupFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** GroupFindingsRequest pageToken */ + pageToken?: (string|null); + + /** GroupFindingsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a GroupFindingsRequest. */ + class GroupFindingsRequest implements IGroupFindingsRequest { + + /** + * Constructs a new GroupFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupFindingsRequest); + + /** GroupFindingsRequest parent. */ + public parent: string; + + /** GroupFindingsRequest filter. */ + public filter: string; + + /** GroupFindingsRequest groupBy. */ + public groupBy: string; + + /** GroupFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** GroupFindingsRequest pageToken. */ + public pageToken: string; + + /** GroupFindingsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupFindingsRequest): google.cloud.securitycenter.v1.GroupFindingsRequest; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupFindingsRequest; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupFindingsRequest; + + /** + * Verifies a GroupFindingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupFindingsRequest; + + /** + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * @param message GroupFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupFindingsResponse. */ + interface IGroupFindingsResponse { + + /** GroupFindingsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1.IGroupResult[]|null); + + /** GroupFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** GroupFindingsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a GroupFindingsResponse. */ + class GroupFindingsResponse implements IGroupFindingsResponse { + + /** + * Constructs a new GroupFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupFindingsResponse); + + /** GroupFindingsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1.IGroupResult[]; + + /** GroupFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** GroupFindingsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupFindingsResponse): google.cloud.securitycenter.v1.GroupFindingsResponse; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupFindingsResponse; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupFindingsResponse; + + /** + * Verifies a GroupFindingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupFindingsResponse; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @param message GroupFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupResult. */ + interface IGroupResult { + + /** GroupResult properties */ + properties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** GroupResult count */ + count?: (number|Long|string|null); + } + + /** Represents a GroupResult. */ + class GroupResult implements IGroupResult { + + /** + * Constructs a new GroupResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupResult); + + /** GroupResult properties. */ + public properties: { [k: string]: google.protobuf.IValue }; + + /** GroupResult count. */ + public count: (number|Long|string); + + /** + * Creates a new GroupResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupResult): google.cloud.securitycenter.v1.GroupResult; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupResult; + + /** + * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupResult; + + /** + * Verifies a GroupResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupResult; + + /** + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @param message GroupResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMuteConfigsRequest. */ + interface IListMuteConfigsRequest { + + /** ListMuteConfigsRequest parent */ + parent?: (string|null); + + /** ListMuteConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListMuteConfigsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListMuteConfigsRequest. */ + class ListMuteConfigsRequest implements IListMuteConfigsRequest { + + /** + * Constructs a new ListMuteConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListMuteConfigsRequest); + + /** ListMuteConfigsRequest parent. */ + public parent: string; + + /** ListMuteConfigsRequest pageSize. */ + public pageSize: number; + + /** ListMuteConfigsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListMuteConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMuteConfigsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListMuteConfigsRequest): google.cloud.securitycenter.v1.ListMuteConfigsRequest; + + /** + * Encodes the specified ListMuteConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. + * @param message ListMuteConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListMuteConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMuteConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. + * @param message ListMuteConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListMuteConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMuteConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListMuteConfigsRequest; + + /** + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMuteConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListMuteConfigsRequest; + + /** + * Verifies a ListMuteConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMuteConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMuteConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListMuteConfigsRequest; + + /** + * Creates a plain object from a ListMuteConfigsRequest message. Also converts values to other types if specified. + * @param message ListMuteConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListMuteConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMuteConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMuteConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMuteConfigsResponse. */ + interface IListMuteConfigsResponse { + + /** ListMuteConfigsResponse muteConfigs */ + muteConfigs?: (google.cloud.securitycenter.v1.IMuteConfig[]|null); + + /** ListMuteConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMuteConfigsResponse. */ + class ListMuteConfigsResponse implements IListMuteConfigsResponse { + + /** + * Constructs a new ListMuteConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListMuteConfigsResponse); + + /** ListMuteConfigsResponse muteConfigs. */ + public muteConfigs: google.cloud.securitycenter.v1.IMuteConfig[]; + + /** ListMuteConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMuteConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMuteConfigsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListMuteConfigsResponse): google.cloud.securitycenter.v1.ListMuteConfigsResponse; + + /** + * Encodes the specified ListMuteConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. + * @param message ListMuteConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListMuteConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMuteConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. + * @param message ListMuteConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListMuteConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMuteConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListMuteConfigsResponse; + + /** + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMuteConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListMuteConfigsResponse; + + /** + * Verifies a ListMuteConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMuteConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMuteConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListMuteConfigsResponse; + + /** + * Creates a plain object from a ListMuteConfigsResponse message. Also converts values to other types if specified. + * @param message ListMuteConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListMuteConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMuteConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMuteConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListNotificationConfigsRequest. */ + interface IListNotificationConfigsRequest { + + /** ListNotificationConfigsRequest parent */ + parent?: (string|null); + + /** ListNotificationConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListNotificationConfigsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListNotificationConfigsRequest. */ + class ListNotificationConfigsRequest implements IListNotificationConfigsRequest { + + /** + * Constructs a new ListNotificationConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListNotificationConfigsRequest); + + /** ListNotificationConfigsRequest parent. */ + public parent: string; + + /** ListNotificationConfigsRequest pageToken. */ + public pageToken: string; + + /** ListNotificationConfigsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListNotificationConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNotificationConfigsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListNotificationConfigsRequest): google.cloud.securitycenter.v1.ListNotificationConfigsRequest; + + /** + * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsRequest.verify|verify} messages. + * @param message ListNotificationConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListNotificationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNotificationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsRequest.verify|verify} messages. + * @param message ListNotificationConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListNotificationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNotificationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListNotificationConfigsRequest; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNotificationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListNotificationConfigsRequest; + + /** + * Verifies a ListNotificationConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNotificationConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListNotificationConfigsRequest; + + /** + * Creates a plain object from a ListNotificationConfigsRequest message. Also converts values to other types if specified. + * @param message ListNotificationConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListNotificationConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNotificationConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNotificationConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListNotificationConfigsResponse. */ + interface IListNotificationConfigsResponse { + + /** ListNotificationConfigsResponse notificationConfigs */ + notificationConfigs?: (google.cloud.securitycenter.v1.INotificationConfig[]|null); + + /** ListNotificationConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListNotificationConfigsResponse. */ + class ListNotificationConfigsResponse implements IListNotificationConfigsResponse { + + /** + * Constructs a new ListNotificationConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListNotificationConfigsResponse); + + /** ListNotificationConfigsResponse notificationConfigs. */ + public notificationConfigs: google.cloud.securitycenter.v1.INotificationConfig[]; + + /** ListNotificationConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListNotificationConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNotificationConfigsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListNotificationConfigsResponse): google.cloud.securitycenter.v1.ListNotificationConfigsResponse; + + /** + * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsResponse.verify|verify} messages. + * @param message ListNotificationConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListNotificationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNotificationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsResponse.verify|verify} messages. + * @param message ListNotificationConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListNotificationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNotificationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListNotificationConfigsResponse; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNotificationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListNotificationConfigsResponse; + + /** + * Verifies a ListNotificationConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNotificationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNotificationConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListNotificationConfigsResponse; + + /** + * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. + * @param message ListNotificationConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListNotificationConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNotificationConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNotificationConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSourcesRequest. */ + interface IListSourcesRequest { + + /** ListSourcesRequest parent */ + parent?: (string|null); + + /** ListSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListSourcesRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListSourcesRequest. */ + class ListSourcesRequest implements IListSourcesRequest { + + /** + * Constructs a new ListSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListSourcesRequest); + + /** ListSourcesRequest parent. */ + public parent: string; + + /** ListSourcesRequest pageToken. */ + public pageToken: string; + + /** ListSourcesRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListSourcesRequest): google.cloud.securitycenter.v1.ListSourcesRequest; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListSourcesRequest; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListSourcesRequest; + + /** + * Verifies a ListSourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListSourcesRequest; + + /** + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * @param message ListSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSourcesResponse. */ + interface IListSourcesResponse { + + /** ListSourcesResponse sources */ + sources?: (google.cloud.securitycenter.v1.ISource[]|null); + + /** ListSourcesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSourcesResponse. */ + class ListSourcesResponse implements IListSourcesResponse { + + /** + * Constructs a new ListSourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListSourcesResponse); + + /** ListSourcesResponse sources. */ + public sources: google.cloud.securitycenter.v1.ISource[]; + + /** ListSourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListSourcesResponse): google.cloud.securitycenter.v1.ListSourcesResponse; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListSourcesResponse; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListSourcesResponse; + + /** + * Verifies a ListSourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListSourcesResponse; + + /** + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @param message ListSourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { + + /** ListAssetsRequest parent */ + parent?: (string|null); + + /** ListAssetsRequest filter */ + filter?: (string|null); + + /** ListAssetsRequest orderBy */ + orderBy?: (string|null); + + /** ListAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** ListAssetsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); + + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { + + /** + * Constructs a new ListAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListAssetsRequest); + + /** ListAssetsRequest parent. */ + public parent: string; + + /** ListAssetsRequest filter. */ + public filter: string; + + /** ListAssetsRequest orderBy. */ + public orderBy: string; + + /** ListAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** ListAssetsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListAssetsRequest pageToken. */ + public pageToken: string; + + /** ListAssetsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListAssetsRequest): google.cloud.securitycenter.v1.ListAssetsRequest; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListAssetsRequest; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListAssetsRequest; + + /** + * Verifies a ListAssetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAssetsRequest; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { + + /** ListAssetsResponse listAssetsResults */ + listAssetsResults?: (google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[]|null); + + /** ListAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAssetsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { + + /** + * Constructs a new ListAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListAssetsResponse); + + /** ListAssetsResponse listAssetsResults. */ + public listAssetsResults: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[]; + + /** ListAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAssetsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListAssetsResponse): google.cloud.securitycenter.v1.ListAssetsResponse; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListAssetsResponse; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListAssetsResponse; + + /** + * Verifies a ListAssetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAssetsResponse; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListAssetsResponse { + + /** Properties of a ListAssetsResult. */ + interface IListAssetsResult { + + /** ListAssetsResult asset */ + asset?: (google.cloud.securitycenter.v1.IAsset|null); + + /** ListAssetsResult stateChange */ + stateChange?: (google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|keyof typeof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|null); + } + + /** Represents a ListAssetsResult. */ + class ListAssetsResult implements IListAssetsResult { + + /** + * Constructs a new ListAssetsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult); + + /** ListAssetsResult asset. */ + public asset?: (google.cloud.securitycenter.v1.IAsset|null); + + /** ListAssetsResult stateChange. */ + public stateChange: (google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|keyof typeof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange); + + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult): google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; + + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; + + /** + * Verifies a ListAssetsResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @param message ListAssetsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListAssetsResult { + + /** StateChange enum. */ + enum StateChange { + UNUSED = 0, + ADDED = 1, + REMOVED = 2, + ACTIVE = 3 + } + } + } + + /** Properties of a ListFindingsRequest. */ + interface IListFindingsRequest { + + /** ListFindingsRequest parent */ + parent?: (string|null); + + /** ListFindingsRequest filter */ + filter?: (string|null); + + /** ListFindingsRequest orderBy */ + orderBy?: (string|null); + + /** ListFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** ListFindingsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|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.securitycenter.v1.IListFindingsRequest); + + /** ListFindingsRequest parent. */ + public parent: string; + + /** ListFindingsRequest filter. */ + public filter: string; + + /** ListFindingsRequest orderBy. */ + public orderBy: string; + + /** ListFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** ListFindingsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** 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.securitycenter.v1.IListFindingsRequest): google.cloud.securitycenter.v1.ListFindingsRequest; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.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.securitycenter.v1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.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.securitycenter.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.securitycenter.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.securitycenter.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.securitycenter.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.securitycenter.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 listFindingsResults */ + listFindingsResults?: (google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[]|null); + + /** ListFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListFindingsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListFindingsResponse. */ + class ListFindingsResponse implements IListFindingsResponse { + + /** + * Constructs a new ListFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListFindingsResponse); + + /** ListFindingsResponse listFindingsResults. */ + public listFindingsResults: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[]; + + /** ListFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListFindingsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListFindingsResponse): google.cloud.securitycenter.v1.ListFindingsResponse; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.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.securitycenter.v1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.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.securitycenter.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.securitycenter.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.securitycenter.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.securitycenter.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.securitycenter.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; + } + + namespace ListFindingsResponse { + + /** Properties of a ListFindingsResult. */ + interface IListFindingsResult { + + /** ListFindingsResult finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** ListFindingsResult stateChange */ + stateChange?: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|keyof typeof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null); + + /** ListFindingsResult resource */ + resource?: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null); + } + + /** Represents a ListFindingsResult. */ + class ListFindingsResult implements IListFindingsResult { + + /** + * Constructs a new ListFindingsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult); + + /** ListFindingsResult finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** ListFindingsResult stateChange. */ + public stateChange: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|keyof typeof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange); + + /** ListFindingsResult resource. */ + public resource?: (google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null); + + /** + * Creates a new ListFindingsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; + + /** + * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @param message ListFindingsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @param message ListFindingsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; + + /** + * Verifies a ListFindingsResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult; + + /** + * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. + * @param message ListFindingsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListFindingsResult { + + /** StateChange enum. */ + enum StateChange { + UNUSED = 0, + CHANGED = 1, + UNCHANGED = 2, + ADDED = 3, + REMOVED = 4 + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource name */ + name?: (string|null); + + /** Resource displayName */ + displayName?: (string|null); + + /** Resource type */ + type?: (string|null); + + /** Resource projectName */ + projectName?: (string|null); + + /** Resource projectDisplayName */ + projectDisplayName?: (string|null); + + /** Resource parentName */ + parentName?: (string|null); + + /** Resource parentDisplayName */ + parentDisplayName?: (string|null); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1.IFolder[]|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource); + + /** Resource name. */ + public name: string; + + /** Resource displayName. */ + public displayName: string; + + /** Resource type. */ + public type: string; + + /** Resource projectName. */ + public projectName: string; + + /** Resource projectDisplayName. */ + public projectDisplayName: string; + + /** Resource parentName. */ + public parentName: string; + + /** Resource parentDisplayName. */ + public parentDisplayName: string; + + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1.IFolder[]; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Verifies a Resource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a SetFindingStateRequest. */ + interface ISetFindingStateRequest { + + /** SetFindingStateRequest name */ + name?: (string|null); + + /** SetFindingStateRequest state */ + state?: (google.cloud.securitycenter.v1.Finding.State|keyof typeof google.cloud.securitycenter.v1.Finding.State|null); + + /** SetFindingStateRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SetFindingStateRequest. */ + class SetFindingStateRequest implements ISetFindingStateRequest { + + /** + * Constructs a new SetFindingStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISetFindingStateRequest); + + /** SetFindingStateRequest name. */ + public name: string; + + /** SetFindingStateRequest state. */ + public state: (google.cloud.securitycenter.v1.Finding.State|keyof typeof google.cloud.securitycenter.v1.Finding.State); + + /** SetFindingStateRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetFindingStateRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISetFindingStateRequest): google.cloud.securitycenter.v1.SetFindingStateRequest; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.SetFindingStateRequest; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.SetFindingStateRequest; + + /** + * Verifies a SetFindingStateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetFindingStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SetFindingStateRequest; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @param message SetFindingStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetFindingStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SetMuteRequest. */ + interface ISetMuteRequest { + + /** SetMuteRequest name */ + name?: (string|null); + + /** SetMuteRequest mute */ + mute?: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute|null); + } + + /** Represents a SetMuteRequest. */ + class SetMuteRequest implements ISetMuteRequest { + + /** + * Constructs a new SetMuteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISetMuteRequest); + + /** SetMuteRequest name. */ + public name: string; + + /** SetMuteRequest mute. */ + public mute: (google.cloud.securitycenter.v1.Finding.Mute|keyof typeof google.cloud.securitycenter.v1.Finding.Mute); + + /** + * Creates a new SetMuteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetMuteRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISetMuteRequest): google.cloud.securitycenter.v1.SetMuteRequest; + + /** + * Encodes the specified SetMuteRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. + * @param message SetMuteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISetMuteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetMuteRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. + * @param message SetMuteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISetMuteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetMuteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetMuteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.SetMuteRequest; + + /** + * Decodes a SetMuteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetMuteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.SetMuteRequest; + + /** + * Verifies a SetMuteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetMuteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetMuteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.SetMuteRequest; + + /** + * Creates a plain object from a SetMuteRequest message. Also converts values to other types if specified. + * @param message SetMuteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.SetMuteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetMuteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetMuteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunAssetDiscoveryRequest. */ + interface IRunAssetDiscoveryRequest { + + /** RunAssetDiscoveryRequest parent */ + parent?: (string|null); + } + + /** Represents a RunAssetDiscoveryRequest. */ + class RunAssetDiscoveryRequest implements IRunAssetDiscoveryRequest { + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest); + + /** RunAssetDiscoveryRequest parent. */ + public parent: string; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; + + /** + * Verifies a RunAssetDiscoveryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAssetDiscoveryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateExternalSystemRequest. */ + interface IUpdateExternalSystemRequest { + + /** UpdateExternalSystemRequest externalSystem */ + externalSystem?: (google.cloud.securitycenter.v1.IExternalSystem|null); + + /** UpdateExternalSystemRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateExternalSystemRequest. */ + class UpdateExternalSystemRequest implements IUpdateExternalSystemRequest { + + /** + * Constructs a new UpdateExternalSystemRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateExternalSystemRequest); + + /** UpdateExternalSystemRequest externalSystem. */ + public externalSystem?: (google.cloud.securitycenter.v1.IExternalSystem|null); + + /** UpdateExternalSystemRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateExternalSystemRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExternalSystemRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateExternalSystemRequest): google.cloud.securitycenter.v1.UpdateExternalSystemRequest; + + /** + * Encodes the specified UpdateExternalSystemRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateExternalSystemRequest.verify|verify} messages. + * @param message UpdateExternalSystemRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExternalSystemRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateExternalSystemRequest.verify|verify} messages. + * @param message UpdateExternalSystemRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExternalSystemRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExternalSystemRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateExternalSystemRequest; + + /** + * Decodes an UpdateExternalSystemRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExternalSystemRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateExternalSystemRequest; + + /** + * Verifies an UpdateExternalSystemRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateExternalSystemRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExternalSystemRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateExternalSystemRequest; + + /** + * Creates a plain object from an UpdateExternalSystemRequest message. Also converts values to other types if specified. + * @param message UpdateExternalSystemRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateExternalSystemRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExternalSystemRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExternalSystemRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateFindingRequest. */ + interface IUpdateFindingRequest { + + /** UpdateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** UpdateFindingRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFindingRequest. */ + class UpdateFindingRequest implements IUpdateFindingRequest { + + /** + * Constructs a new UpdateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateFindingRequest); + + /** UpdateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1.IFinding|null); + + /** UpdateFindingRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFindingRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateFindingRequest): google.cloud.securitycenter.v1.UpdateFindingRequest; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateFindingRequest; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateFindingRequest; + + /** + * Verifies an UpdateFindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateFindingRequest; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @param message UpdateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMuteConfigRequest. */ + interface IUpdateMuteConfigRequest { + + /** UpdateMuteConfigRequest muteConfig */ + muteConfig?: (google.cloud.securitycenter.v1.IMuteConfig|null); + + /** UpdateMuteConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateMuteConfigRequest. */ + class UpdateMuteConfigRequest implements IUpdateMuteConfigRequest { + + /** + * Constructs a new UpdateMuteConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest); + + /** UpdateMuteConfigRequest muteConfig. */ + public muteConfig?: (google.cloud.securitycenter.v1.IMuteConfig|null); + + /** UpdateMuteConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateMuteConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMuteConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest): google.cloud.securitycenter.v1.UpdateMuteConfigRequest; + + /** + * Encodes the specified UpdateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateMuteConfigRequest.verify|verify} messages. + * @param message UpdateMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateMuteConfigRequest.verify|verify} messages. + * @param message UpdateMuteConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMuteConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateMuteConfigRequest; + + /** + * Decodes an UpdateMuteConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateMuteConfigRequest; + + /** + * Verifies an UpdateMuteConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMuteConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateMuteConfigRequest; + + /** + * Creates a plain object from an UpdateMuteConfigRequest message. Also converts values to other types if specified. + * @param message UpdateMuteConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateMuteConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMuteConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMuteConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateNotificationConfigRequest. */ + interface IUpdateNotificationConfigRequest { + + /** UpdateNotificationConfigRequest notificationConfig */ + notificationConfig?: (google.cloud.securitycenter.v1.INotificationConfig|null); + + /** UpdateNotificationConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateNotificationConfigRequest. */ + class UpdateNotificationConfigRequest implements IUpdateNotificationConfigRequest { + + /** + * Constructs a new UpdateNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest); + + /** UpdateNotificationConfigRequest notificationConfig. */ + public notificationConfig?: (google.cloud.securitycenter.v1.INotificationConfig|null); + + /** UpdateNotificationConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest): google.cloud.securitycenter.v1.UpdateNotificationConfigRequest; + + /** + * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.verify|verify} messages. + * @param message UpdateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.verify|verify} messages. + * @param message UpdateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateNotificationConfigRequest; + + /** + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateNotificationConfigRequest; + + /** + * Verifies an UpdateNotificationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateNotificationConfigRequest; + + /** + * Creates a plain object from an UpdateNotificationConfigRequest message. Also converts values to other types if specified. + * @param message UpdateNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateOrganizationSettingsRequest. */ + interface IUpdateOrganizationSettingsRequest { + + /** UpdateOrganizationSettingsRequest organizationSettings */ + organizationSettings?: (google.cloud.securitycenter.v1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateOrganizationSettingsRequest. */ + class UpdateOrganizationSettingsRequest implements IUpdateOrganizationSettingsRequest { + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest); + + /** UpdateOrganizationSettingsRequest organizationSettings. */ + public organizationSettings?: (google.cloud.securitycenter.v1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOrganizationSettingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; + + /** + * Verifies an UpdateOrganizationSettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOrganizationSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateOrganizationSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSourceRequest. */ + interface IUpdateSourceRequest { + + /** UpdateSourceRequest source */ + source?: (google.cloud.securitycenter.v1.ISource|null); + + /** UpdateSourceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSourceRequest. */ + class UpdateSourceRequest implements IUpdateSourceRequest { + + /** + * Constructs a new UpdateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateSourceRequest); + + /** UpdateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1.ISource|null); + + /** UpdateSourceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateSourceRequest): google.cloud.securitycenter.v1.UpdateSourceRequest; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateSourceRequest; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateSourceRequest; + + /** + * Verifies an UpdateSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateSourceRequest; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @param message UpdateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSecurityMarksRequest. */ + interface IUpdateSecurityMarksRequest { + + /** UpdateSecurityMarksRequest securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateSecurityMarksRequest. */ + class UpdateSecurityMarksRequest implements IUpdateSecurityMarksRequest { + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest); + + /** UpdateSecurityMarksRequest securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSecurityMarksRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; + + /** + * Verifies an UpdateSecurityMarksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSecurityMarksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @param message UpdateSecurityMarksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSecurityMarksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBigQueryExportRequest. */ + interface ICreateBigQueryExportRequest { + + /** CreateBigQueryExportRequest parent */ + parent?: (string|null); + + /** CreateBigQueryExportRequest bigQueryExport */ + bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); + + /** CreateBigQueryExportRequest bigQueryExportId */ + bigQueryExportId?: (string|null); + } + + /** Represents a CreateBigQueryExportRequest. */ + class CreateBigQueryExportRequest implements ICreateBigQueryExportRequest { + + /** + * Constructs a new CreateBigQueryExportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest); + + /** CreateBigQueryExportRequest parent. */ + public parent: string; + + /** CreateBigQueryExportRequest bigQueryExport. */ + public bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); + + /** CreateBigQueryExportRequest bigQueryExportId. */ + public bigQueryExportId: string; + + /** + * Creates a new CreateBigQueryExportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBigQueryExportRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest): google.cloud.securitycenter.v1.CreateBigQueryExportRequest; + + /** + * Encodes the specified CreateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateBigQueryExportRequest.verify|verify} messages. + * @param message CreateBigQueryExportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateBigQueryExportRequest.verify|verify} messages. + * @param message CreateBigQueryExportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.CreateBigQueryExportRequest; + + /** + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.CreateBigQueryExportRequest; + + /** + * Verifies a CreateBigQueryExportRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBigQueryExportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.CreateBigQueryExportRequest; + + /** + * Creates a plain object from a CreateBigQueryExportRequest message. Also converts values to other types if specified. + * @param message CreateBigQueryExportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.CreateBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBigQueryExportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBigQueryExportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBigQueryExportRequest. */ + interface IUpdateBigQueryExportRequest { + + /** UpdateBigQueryExportRequest bigQueryExport */ + bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); + + /** UpdateBigQueryExportRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBigQueryExportRequest. */ + class UpdateBigQueryExportRequest implements IUpdateBigQueryExportRequest { + + /** + * Constructs a new UpdateBigQueryExportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest); + + /** UpdateBigQueryExportRequest bigQueryExport. */ + public bigQueryExport?: (google.cloud.securitycenter.v1.IBigQueryExport|null); + + /** UpdateBigQueryExportRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBigQueryExportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBigQueryExportRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest): google.cloud.securitycenter.v1.UpdateBigQueryExportRequest; + + /** + * Encodes the specified UpdateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.verify|verify} messages. + * @param message UpdateBigQueryExportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.verify|verify} messages. + * @param message UpdateBigQueryExportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.UpdateBigQueryExportRequest; + + /** + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.UpdateBigQueryExportRequest; + + /** + * Verifies an UpdateBigQueryExportRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBigQueryExportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.UpdateBigQueryExportRequest; + + /** + * Creates a plain object from an UpdateBigQueryExportRequest message. Also converts values to other types if specified. + * @param message UpdateBigQueryExportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.UpdateBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBigQueryExportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBigQueryExportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBigQueryExportsRequest. */ + interface IListBigQueryExportsRequest { + + /** ListBigQueryExportsRequest parent */ + parent?: (string|null); + + /** ListBigQueryExportsRequest pageSize */ + pageSize?: (number|null); + + /** ListBigQueryExportsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBigQueryExportsRequest. */ + class ListBigQueryExportsRequest implements IListBigQueryExportsRequest { + + /** + * Constructs a new ListBigQueryExportsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListBigQueryExportsRequest); + + /** ListBigQueryExportsRequest parent. */ + public parent: string; + + /** ListBigQueryExportsRequest pageSize. */ + public pageSize: number; + + /** ListBigQueryExportsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListBigQueryExportsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBigQueryExportsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListBigQueryExportsRequest): google.cloud.securitycenter.v1.ListBigQueryExportsRequest; + + /** + * Encodes the specified ListBigQueryExportsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsRequest.verify|verify} messages. + * @param message ListBigQueryExportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListBigQueryExportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBigQueryExportsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsRequest.verify|verify} messages. + * @param message ListBigQueryExportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListBigQueryExportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBigQueryExportsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBigQueryExportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListBigQueryExportsRequest; + + /** + * Decodes a ListBigQueryExportsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBigQueryExportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListBigQueryExportsRequest; + + /** + * Verifies a ListBigQueryExportsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBigQueryExportsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBigQueryExportsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListBigQueryExportsRequest; + + /** + * Creates a plain object from a ListBigQueryExportsRequest message. Also converts values to other types if specified. + * @param message ListBigQueryExportsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListBigQueryExportsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBigQueryExportsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBigQueryExportsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBigQueryExportsResponse. */ + interface IListBigQueryExportsResponse { + + /** ListBigQueryExportsResponse bigQueryExports */ + bigQueryExports?: (google.cloud.securitycenter.v1.IBigQueryExport[]|null); + + /** ListBigQueryExportsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBigQueryExportsResponse. */ + class ListBigQueryExportsResponse implements IListBigQueryExportsResponse { + + /** + * Constructs a new ListBigQueryExportsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IListBigQueryExportsResponse); + + /** ListBigQueryExportsResponse bigQueryExports. */ + public bigQueryExports: google.cloud.securitycenter.v1.IBigQueryExport[]; + + /** ListBigQueryExportsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBigQueryExportsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBigQueryExportsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IListBigQueryExportsResponse): google.cloud.securitycenter.v1.ListBigQueryExportsResponse; + + /** + * Encodes the specified ListBigQueryExportsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsResponse.verify|verify} messages. + * @param message ListBigQueryExportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IListBigQueryExportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBigQueryExportsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsResponse.verify|verify} messages. + * @param message ListBigQueryExportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IListBigQueryExportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBigQueryExportsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBigQueryExportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ListBigQueryExportsResponse; + + /** + * Decodes a ListBigQueryExportsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBigQueryExportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ListBigQueryExportsResponse; + + /** + * Verifies a ListBigQueryExportsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBigQueryExportsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBigQueryExportsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ListBigQueryExportsResponse; + + /** + * Creates a plain object from a ListBigQueryExportsResponse message. Also converts values to other types if specified. + * @param message ListBigQueryExportsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ListBigQueryExportsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBigQueryExportsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBigQueryExportsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBigQueryExportRequest. */ + interface IDeleteBigQueryExportRequest { + + /** DeleteBigQueryExportRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBigQueryExportRequest. */ + class DeleteBigQueryExportRequest implements IDeleteBigQueryExportRequest { + + /** + * Constructs a new DeleteBigQueryExportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest); + + /** DeleteBigQueryExportRequest name. */ + public name: string; + + /** + * Creates a new DeleteBigQueryExportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBigQueryExportRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest): google.cloud.securitycenter.v1.DeleteBigQueryExportRequest; + + /** + * Encodes the specified DeleteBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteBigQueryExportRequest.verify|verify} messages. + * @param message DeleteBigQueryExportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteBigQueryExportRequest.verify|verify} messages. + * @param message DeleteBigQueryExportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBigQueryExportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.DeleteBigQueryExportRequest; + + /** + * Decodes a DeleteBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.DeleteBigQueryExportRequest; + + /** + * Verifies a DeleteBigQueryExportRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBigQueryExportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.DeleteBigQueryExportRequest; + + /** + * Creates a plain object from a DeleteBigQueryExportRequest message. Also converts values to other types if specified. + * @param message DeleteBigQueryExportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.DeleteBigQueryExportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBigQueryExportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBigQueryExportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Source. */ + interface ISource { + + /** Source name */ + name?: (string|null); + + /** Source displayName */ + displayName?: (string|null); + + /** Source description */ + description?: (string|null); + + /** Source canonicalName */ + canonicalName?: (string|null); + } + + /** Represents a Source. */ + class Source implements ISource { + + /** + * Constructs a new Source. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.ISource); + + /** Source name. */ + public name: string; + + /** Source displayName. */ + public displayName: string; + + /** Source description. */ + public description: string; + + /** Source canonicalName. */ + public canonicalName: string; + + /** + * Creates a new Source instance using the specified properties. + * @param [properties] Properties to set + * @returns Source instance + */ + public static create(properties?: google.cloud.securitycenter.v1.ISource): google.cloud.securitycenter.v1.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Source message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.Source; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.Source; + + /** + * Verifies a Source message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Source + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.Source; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Source + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset securityCenterProperties */ + securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties */ + resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Asset securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Asset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset securityCenterProperties. */ + public securityCenterProperties?: (google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties. */ + public resourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Asset securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Asset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IAsset): google.cloud.securitycenter.v1beta1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.Asset; + + /** + * Verifies an Asset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Asset { + + /** Properties of a SecurityCenterProperties. */ + interface ISecurityCenterProperties { + + /** SecurityCenterProperties resourceName */ + resourceName?: (string|null); + + /** SecurityCenterProperties resourceType */ + resourceType?: (string|null); + + /** SecurityCenterProperties resourceParent */ + resourceParent?: (string|null); + + /** SecurityCenterProperties resourceProject */ + resourceProject?: (string|null); + + /** SecurityCenterProperties resourceOwners */ + resourceOwners?: (string[]|null); + } + + /** Represents a SecurityCenterProperties. */ + class SecurityCenterProperties implements ISecurityCenterProperties { + + /** + * Constructs a new SecurityCenterProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties); + + /** SecurityCenterProperties resourceName. */ + public resourceName: string; + + /** SecurityCenterProperties resourceType. */ + public resourceType: string; + + /** SecurityCenterProperties resourceParent. */ + public resourceParent: string; + + /** SecurityCenterProperties resourceProject. */ + public resourceProject: string; + + /** SecurityCenterProperties resourceOwners. */ + public resourceOwners: string[]; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityCenterProperties instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties): google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + + /** + * Verifies a SecurityCenterProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityCenterProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @param message SecurityCenterProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityCenterProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SecurityMarks. */ + interface ISecurityMarks { + + /** SecurityMarks name */ + name?: (string|null); + + /** SecurityMarks marks */ + marks?: ({ [k: string]: string }|null); + } + + /** Represents a SecurityMarks. */ + class SecurityMarks implements ISecurityMarks { + + /** + * Constructs a new SecurityMarks. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ISecurityMarks); + + /** SecurityMarks name. */ + public name: string; + + /** SecurityMarks marks. */ + public marks: { [k: string]: string }; + + /** + * Creates a new SecurityMarks instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityMarks instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ISecurityMarks): google.cloud.securitycenter.v1beta1.SecurityMarks; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.SecurityMarks; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.SecurityMarks; + + /** + * Verifies a SecurityMarks message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityMarks + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.SecurityMarks; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @param message SecurityMarks + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityMarks to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityMarks + * @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 parent */ + parent?: (string|null); + + /** Finding resourceName */ + resourceName?: (string|null); + + /** Finding state */ + state?: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State|null); + + /** Finding category */ + category?: (string|null); + + /** Finding externalUri */ + externalUri?: (string|null); + + /** Finding sourceProperties */ + sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Finding securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Finding eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Finding. */ + class Finding implements IFinding { + + /** + * Constructs a new Finding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IFinding); + + /** Finding name. */ + public name: string; + + /** Finding parent. */ + public parent: string; + + /** Finding resourceName. */ + public resourceName: string; + + /** Finding state. */ + public state: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State); + + /** Finding category. */ + public category: string; + + /** Finding externalUri. */ + public externalUri: string; + + /** Finding sourceProperties. */ + public sourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Finding securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** Finding eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Finding instance using the specified properties. + * @param [properties] Properties to set + * @returns Finding instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IFinding): google.cloud.securitycenter.v1beta1.Finding; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.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 { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2 + } + } + + /** Properties of an OrganizationSettings. */ + interface IOrganizationSettings { + + /** OrganizationSettings name */ + name?: (string|null); + + /** OrganizationSettings enableAssetDiscovery */ + enableAssetDiscovery?: (boolean|null); + + /** OrganizationSettings assetDiscoveryConfig */ + assetDiscoveryConfig?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null); + } + + /** Represents an OrganizationSettings. */ + class OrganizationSettings implements IOrganizationSettings { + + /** + * Constructs a new OrganizationSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IOrganizationSettings); + + /** OrganizationSettings name. */ + public name: string; + + /** OrganizationSettings enableAssetDiscovery. */ + public enableAssetDiscovery: boolean; + + /** OrganizationSettings assetDiscoveryConfig. */ + public assetDiscoveryConfig?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null); + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns OrganizationSettings instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IOrganizationSettings): google.cloud.securitycenter.v1beta1.OrganizationSettings; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.OrganizationSettings; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.OrganizationSettings; + + /** + * Verifies an OrganizationSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrganizationSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.OrganizationSettings; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @param message OrganizationSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.OrganizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrganizationSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrganizationSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OrganizationSettings { + + /** Properties of an AssetDiscoveryConfig. */ + interface IAssetDiscoveryConfig { + + /** AssetDiscoveryConfig projectIds */ + projectIds?: (string[]|null); + + /** AssetDiscoveryConfig inclusionMode */ + inclusionMode?: (google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + } + + /** Represents an AssetDiscoveryConfig. */ + class AssetDiscoveryConfig implements IAssetDiscoveryConfig { + + /** + * Constructs a new AssetDiscoveryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig); + + /** AssetDiscoveryConfig projectIds. */ + public projectIds: string[]; + + /** AssetDiscoveryConfig inclusionMode. */ + public inclusionMode: (google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode); + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AssetDiscoveryConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig): google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Verifies an AssetDiscoveryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssetDiscoveryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @param message AssetDiscoveryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AssetDiscoveryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AssetDiscoveryConfig { + + /** InclusionMode enum. */ + enum InclusionMode { + INCLUSION_MODE_UNSPECIFIED = 0, + INCLUDE_ONLY = 1, + EXCLUDE = 2 + } + } + } + + /** Properties of a RunAssetDiscoveryResponse. */ + interface IRunAssetDiscoveryResponse { + + /** RunAssetDiscoveryResponse state */ + state?: (google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|null); + + /** RunAssetDiscoveryResponse duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a RunAssetDiscoveryResponse. */ + class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse); + + /** RunAssetDiscoveryResponse state. */ + public state: (google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State); + + /** RunAssetDiscoveryResponse duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; + + /** + * Verifies a RunAssetDiscoveryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAssetDiscoveryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RunAssetDiscoveryResponse { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + COMPLETED = 1, + SUPERSEDED = 2, + TERMINATED = 3 + } + } + + /** Represents a SecurityCenter */ + class SecurityCenter extends $protobuf.rpc.Service { + + /** + * Constructs a new SecurityCenter 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 SecurityCenter 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): SecurityCenter; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public createSource(request: google.cloud.securitycenter.v1beta1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSourceCallback): void; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @returns Promise + */ + public createSource(request: google.cloud.securitycenter.v1beta1.ICreateSourceRequest): Promise; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public createFinding(request: google.cloud.securitycenter.v1beta1.ICreateFindingRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFindingCallback): void; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @returns Promise + */ + public createFinding(request: google.cloud.securitycenter.v1beta1.ICreateFindingRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettingsCallback): void; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest): Promise; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public getSource(request: google.cloud.securitycenter.v1beta1.IGetSourceRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GetSourceCallback): void; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @returns Promise + */ + public getSource(request: google.cloud.securitycenter.v1beta1.IGetSourceRequest): Promise; + + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupAssetsResponse + */ + public groupAssets(request: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssetsCallback): void; + + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @returns Promise + */ + public groupAssets(request: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest): Promise; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupFindingsResponse + */ + public groupFindings(request: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindingsCallback): void; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @returns Promise + */ + public groupFindings(request: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest): Promise; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + */ + public listAssets(request: google.cloud.securitycenter.v1beta1.IListAssetsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssetsCallback): void; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise + */ + public listAssets(request: google.cloud.securitycenter.v1beta1.IListAssetsRequest): 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.securitycenter.v1beta1.IListFindingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindingsCallback): void; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @returns Promise + */ + public listFindings(request: google.cloud.securitycenter.v1beta1.IListFindingsRequest): Promise; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSourcesResponse + */ + public listSources(request: google.cloud.securitycenter.v1beta1.IListSourcesRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.ListSourcesCallback): void; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @returns Promise + */ + public listSources(request: google.cloud.securitycenter.v1beta1.IListSourcesRequest): Promise; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscoveryCallback): void; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @returns Promise + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest): Promise; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public setFindingState(request: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingStateCallback): void; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @returns Promise + */ + public setFindingState(request: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public updateFinding(request: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFindingCallback): void; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @returns Promise + */ + public updateFinding(request: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest): Promise; + + /** + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings + */ + public updateOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettingsCallback): void; + + /** + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public updateOrganizationSettings(request: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest): Promise; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public updateSource(request: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSourceCallback): void; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @returns Promise + */ + public updateSource(request: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest): Promise; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityMarks + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarksCallback): void; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @returns Promise + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest): Promise; + } + + namespace SecurityCenter { + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|createSource}. + * @param error Error, if any + * @param [response] Source + */ + type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|createFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|getOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|getSource}. + * @param error Error, if any + * @param [response] Source + */ + type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|groupAssets}. + * @param error Error, if any + * @param [response] GroupAssetsResponse + */ + type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.GroupAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|groupFindings}. + * @param error Error, if any + * @param [response] GroupFindingsResponse + */ + type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.GroupFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse + */ + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|listFindings}. + * @param error Error, if any + * @param [response] ListFindingsResponse + */ + type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|listSources}. + * @param error Error, if any + * @param [response] ListSourcesResponse + */ + type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.ListSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|runAssetDiscovery}. + * @param error Error, if any + * @param [response] Operation + */ + type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|setFindingState}. + * @param error Error, if any + * @param [response] Finding + */ + type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateSource}. + * @param error Error, if any + * @param [response] Source + */ + type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateSecurityMarks}. + * @param error Error, if any + * @param [response] SecurityMarks + */ + type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1beta1.SecurityMarks) => void; + } + + /** Properties of a CreateFindingRequest. */ + interface ICreateFindingRequest { + + /** CreateFindingRequest parent */ + parent?: (string|null); + + /** CreateFindingRequest findingId */ + findingId?: (string|null); + + /** CreateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + } + + /** Represents a CreateFindingRequest. */ + class CreateFindingRequest implements ICreateFindingRequest { + + /** + * Constructs a new CreateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ICreateFindingRequest); + + /** CreateFindingRequest parent. */ + public parent: string; + + /** CreateFindingRequest findingId. */ + public findingId: string; + + /** CreateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFindingRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ICreateFindingRequest): google.cloud.securitycenter.v1beta1.CreateFindingRequest; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.CreateFindingRequest; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.CreateFindingRequest; + + /** + * Verifies a CreateFindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.CreateFindingRequest; + + /** + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @param message CreateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSourceRequest. */ + interface ICreateSourceRequest { + + /** CreateSourceRequest parent */ + parent?: (string|null); + + /** CreateSourceRequest source */ + source?: (google.cloud.securitycenter.v1beta1.ISource|null); + } + + /** Represents a CreateSourceRequest. */ + class CreateSourceRequest implements ICreateSourceRequest { + + /** + * Constructs a new CreateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ICreateSourceRequest); + + /** CreateSourceRequest parent. */ + public parent: string; + + /** CreateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1beta1.ISource|null); + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ICreateSourceRequest): google.cloud.securitycenter.v1beta1.CreateSourceRequest; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.CreateSourceRequest; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.CreateSourceRequest; + + /** + * Verifies a CreateSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.CreateSourceRequest; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @param message CreateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOrganizationSettingsRequest. */ + interface IGetOrganizationSettingsRequest { + + /** GetOrganizationSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetOrganizationSettingsRequest. */ + class GetOrganizationSettingsRequest implements IGetOrganizationSettingsRequest { + + /** + * Constructs a new GetOrganizationSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest); + + /** GetOrganizationSettingsRequest name. */ + public name: string; + + /** + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOrganizationSettingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest): google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; + + /** + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; + + /** + * Verifies a GetOrganizationSettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOrganizationSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; + + /** + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message GetOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOrganizationSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOrganizationSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSourceRequest. */ + interface IGetSourceRequest { + + /** GetSourceRequest name */ + name?: (string|null); + } + + /** Represents a GetSourceRequest. */ + class GetSourceRequest implements IGetSourceRequest { + + /** + * Constructs a new GetSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGetSourceRequest); + + /** GetSourceRequest name. */ + public name: string; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGetSourceRequest): google.cloud.securitycenter.v1beta1.GetSourceRequest; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GetSourceRequest; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GetSourceRequest; + + /** + * Verifies a GetSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GetSourceRequest; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @param message GetSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GetSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupAssetsRequest. */ + interface IGroupAssetsRequest { + + /** GroupAssetsRequest parent */ + parent?: (string|null); + + /** GroupAssetsRequest filter */ + filter?: (string|null); + + /** GroupAssetsRequest groupBy */ + groupBy?: (string|null); + + /** GroupAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest pageToken */ + pageToken?: (string|null); + + /** GroupAssetsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a GroupAssetsRequest. */ + class GroupAssetsRequest implements IGroupAssetsRequest { + + /** + * Constructs a new GroupAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest); + + /** GroupAssetsRequest parent. */ + public parent: string; + + /** GroupAssetsRequest filter. */ + public filter: string; + + /** GroupAssetsRequest groupBy. */ + public groupBy: string; + + /** GroupAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest pageToken. */ + public pageToken: string; + + /** GroupAssetsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest): google.cloud.securitycenter.v1beta1.GroupAssetsRequest; + + /** + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GroupAssetsRequest; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GroupAssetsRequest; + + /** + * Verifies a GroupAssetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupAssetsRequest; + + /** + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * @param message GroupAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupAssetsResponse. */ + interface IGroupAssetsResponse { + + /** GroupAssetsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1beta1.IGroupResult[]|null); + + /** GroupAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a GroupAssetsResponse. */ + class GroupAssetsResponse implements IGroupAssetsResponse { + + /** + * Constructs a new GroupAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse); + + /** GroupAssetsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1beta1.IGroupResult[]; + + /** GroupAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupAssetsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse): google.cloud.securitycenter.v1beta1.GroupAssetsResponse; + + /** + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GroupAssetsResponse; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GroupAssetsResponse; + + /** + * Verifies a GroupAssetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupAssetsResponse; + + /** + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @param message GroupAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupFindingsRequest. */ + interface IGroupFindingsRequest { + + /** GroupFindingsRequest parent */ + parent?: (string|null); + + /** GroupFindingsRequest filter */ + filter?: (string|null); + + /** GroupFindingsRequest groupBy */ + groupBy?: (string|null); + + /** GroupFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsRequest pageToken */ + pageToken?: (string|null); + + /** GroupFindingsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a GroupFindingsRequest. */ + class GroupFindingsRequest implements IGroupFindingsRequest { + + /** + * Constructs a new GroupFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest); + + /** GroupFindingsRequest parent. */ + public parent: string; + + /** GroupFindingsRequest filter. */ + public filter: string; + + /** GroupFindingsRequest groupBy. */ + public groupBy: string; + + /** GroupFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsRequest pageToken. */ + public pageToken: string; + + /** GroupFindingsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest): google.cloud.securitycenter.v1beta1.GroupFindingsRequest; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GroupFindingsRequest; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GroupFindingsRequest; + + /** + * Verifies a GroupFindingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupFindingsRequest; + + /** + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * @param message GroupFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupFindingsResponse. */ + interface IGroupFindingsResponse { + + /** GroupFindingsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1beta1.IGroupResult[]|null); + + /** GroupFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a GroupFindingsResponse. */ + class GroupFindingsResponse implements IGroupFindingsResponse { + + /** + * Constructs a new GroupFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse); + + /** GroupFindingsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1beta1.IGroupResult[]; + + /** GroupFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; + + /** + * Verifies a GroupFindingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupFindingsResponse; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @param message GroupFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupResult. */ + interface IGroupResult { + + /** GroupResult properties */ + properties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** GroupResult count */ + count?: (number|Long|string|null); + } + + /** Represents a GroupResult. */ + class GroupResult implements IGroupResult { + + /** + * Constructs a new GroupResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IGroupResult); + + /** GroupResult properties. */ + public properties: { [k: string]: google.protobuf.IValue }; + + /** GroupResult count. */ + public count: (number|Long|string); + + /** + * Creates a new GroupResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IGroupResult): google.cloud.securitycenter.v1beta1.GroupResult; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.GroupResult; + + /** + * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.GroupResult; + + /** + * Verifies a GroupResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.GroupResult; + + /** + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @param message GroupResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSourcesRequest. */ + interface IListSourcesRequest { + + /** ListSourcesRequest parent */ + parent?: (string|null); + + /** ListSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListSourcesRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListSourcesRequest. */ + class ListSourcesRequest implements IListSourcesRequest { + + /** + * Constructs a new ListSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IListSourcesRequest); + + /** ListSourcesRequest parent. */ + public parent: string; + + /** ListSourcesRequest pageToken. */ + public pageToken: string; + + /** ListSourcesRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IListSourcesRequest): google.cloud.securitycenter.v1beta1.ListSourcesRequest; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.ListSourcesRequest; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.ListSourcesRequest; + + /** + * Verifies a ListSourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListSourcesRequest; + + /** + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * @param message ListSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.ListSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSourcesResponse. */ + interface IListSourcesResponse { + + /** ListSourcesResponse sources */ + sources?: (google.cloud.securitycenter.v1beta1.ISource[]|null); + + /** ListSourcesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSourcesResponse. */ + class ListSourcesResponse implements IListSourcesResponse { + + /** + * Constructs a new ListSourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IListSourcesResponse); + + /** ListSourcesResponse sources. */ + public sources: google.cloud.securitycenter.v1beta1.ISource[]; + + /** ListSourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IListSourcesResponse): google.cloud.securitycenter.v1beta1.ListSourcesResponse; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.ListSourcesResponse; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.ListSourcesResponse; + + /** + * Verifies a ListSourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListSourcesResponse; + + /** + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @param message ListSourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.ListSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { + + /** ListAssetsRequest parent */ + parent?: (string|null); + + /** ListAssetsRequest filter */ + filter?: (string|null); + + /** ListAssetsRequest orderBy */ + orderBy?: (string|null); + + /** ListAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** ListAssetsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); + + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { + + /** + * Constructs a new ListAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IListAssetsRequest); + + /** ListAssetsRequest parent. */ + public parent: string; + + /** ListAssetsRequest filter. */ + public filter: string; + + /** ListAssetsRequest orderBy. */ + public orderBy: string; + + /** ListAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** ListAssetsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListAssetsRequest pageToken. */ + public pageToken: string; + + /** ListAssetsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IListAssetsRequest): google.cloud.securitycenter.v1beta1.ListAssetsRequest; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.ListAssetsRequest; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.ListAssetsRequest; + + /** + * Verifies a ListAssetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListAssetsRequest; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { + + /** ListAssetsResponse listAssetsResults */ + listAssetsResults?: (google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[]|null); + + /** ListAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAssetsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { + + /** + * Constructs a new ListAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IListAssetsResponse); + + /** ListAssetsResponse listAssetsResults. */ + public listAssetsResults: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[]; + + /** ListAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAssetsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IListAssetsResponse): google.cloud.securitycenter.v1beta1.ListAssetsResponse; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.ListAssetsResponse; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.ListAssetsResponse; + + /** + * Verifies a ListAssetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListAssetsResponse; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListAssetsResponse { + + /** Properties of a ListAssetsResult. */ + interface IListAssetsResult { + + /** ListAssetsResult asset */ + asset?: (google.cloud.securitycenter.v1beta1.IAsset|null); + + /** ListAssetsResult state */ + state?: (google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|keyof typeof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|null); + } + + /** Represents a ListAssetsResult. */ + class ListAssetsResult implements IListAssetsResult { + + /** + * Constructs a new ListAssetsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult); + + /** ListAssetsResult asset. */ + public asset?: (google.cloud.securitycenter.v1beta1.IAsset|null); + + /** ListAssetsResult state. */ + public state: (google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|keyof typeof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State); + + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult): google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Verifies a ListAssetsResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @param message ListAssetsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListAssetsResult { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + UNUSED = 1, + ADDED = 2, + REMOVED = 3, + ACTIVE = 4 + } + } + } + + /** Properties of a ListFindingsRequest. */ + interface IListFindingsRequest { + + /** ListFindingsRequest parent */ + parent?: (string|null); + + /** ListFindingsRequest filter */ + filter?: (string|null); + + /** ListFindingsRequest orderBy */ + orderBy?: (string|null); + + /** ListFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|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.securitycenter.v1beta1.IListFindingsRequest); + + /** ListFindingsRequest parent. */ + public parent: string; + + /** ListFindingsRequest filter. */ + public filter: string; + + /** ListFindingsRequest orderBy. */ + public orderBy: string; + + /** ListFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** 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.securitycenter.v1beta1.IListFindingsRequest): google.cloud.securitycenter.v1beta1.ListFindingsRequest; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.IFinding[]|null); + + /** ListFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListFindingsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListFindingsResponse. */ + class ListFindingsResponse implements IListFindingsResponse { + + /** + * Constructs a new ListFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IListFindingsResponse); + + /** ListFindingsResponse findings. */ + public findings: google.cloud.securitycenter.v1beta1.IFinding[]; + + /** ListFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListFindingsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IListFindingsResponse): google.cloud.securitycenter.v1beta1.ListFindingsResponse; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.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 SetFindingStateRequest. */ + interface ISetFindingStateRequest { + + /** SetFindingStateRequest name */ + name?: (string|null); + + /** SetFindingStateRequest state */ + state?: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State|null); + + /** SetFindingStateRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SetFindingStateRequest. */ + class SetFindingStateRequest implements ISetFindingStateRequest { + + /** + * Constructs a new SetFindingStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest); + + /** SetFindingStateRequest name. */ + public name: string; + + /** SetFindingStateRequest state. */ + public state: (google.cloud.securitycenter.v1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1beta1.Finding.State); + + /** SetFindingStateRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetFindingStateRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Verifies a SetFindingStateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetFindingStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.SetFindingStateRequest; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @param message SetFindingStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetFindingStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunAssetDiscoveryRequest. */ + interface IRunAssetDiscoveryRequest { + + /** RunAssetDiscoveryRequest parent */ + parent?: (string|null); + } + + /** Represents a RunAssetDiscoveryRequest. */ + class RunAssetDiscoveryRequest implements IRunAssetDiscoveryRequest { + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest); + + /** RunAssetDiscoveryRequest parent. */ + public parent: string; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Verifies a RunAssetDiscoveryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAssetDiscoveryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateFindingRequest. */ + interface IUpdateFindingRequest { + + /** UpdateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + + /** UpdateFindingRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFindingRequest. */ + class UpdateFindingRequest implements IUpdateFindingRequest { + + /** + * Constructs a new UpdateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest); + + /** UpdateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1beta1.IFinding|null); + + /** UpdateFindingRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFindingRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Verifies an UpdateFindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateFindingRequest; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @param message UpdateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateOrganizationSettingsRequest. */ + interface IUpdateOrganizationSettingsRequest { + + /** UpdateOrganizationSettingsRequest organizationSettings */ + organizationSettings?: (google.cloud.securitycenter.v1beta1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateOrganizationSettingsRequest. */ + class UpdateOrganizationSettingsRequest implements IUpdateOrganizationSettingsRequest { + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest); + + /** UpdateOrganizationSettingsRequest organizationSettings. */ + public organizationSettings?: (google.cloud.securitycenter.v1beta1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOrganizationSettingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Verifies an UpdateOrganizationSettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOrganizationSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateOrganizationSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSourceRequest. */ + interface IUpdateSourceRequest { + + /** UpdateSourceRequest source */ + source?: (google.cloud.securitycenter.v1beta1.ISource|null); + + /** UpdateSourceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSourceRequest. */ + class UpdateSourceRequest implements IUpdateSourceRequest { + + /** + * Constructs a new UpdateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest); + + /** UpdateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1beta1.ISource|null); + + /** UpdateSourceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Verifies an UpdateSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateSourceRequest; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @param message UpdateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSecurityMarksRequest. */ + interface IUpdateSecurityMarksRequest { + + /** UpdateSecurityMarksRequest securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateSecurityMarksRequest. */ + class UpdateSecurityMarksRequest implements IUpdateSecurityMarksRequest { + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest); + + /** UpdateSecurityMarksRequest securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1beta1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSecurityMarksRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Verifies an UpdateSecurityMarksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSecurityMarksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @param message UpdateSecurityMarksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSecurityMarksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Source. */ + interface ISource { + + /** Source name */ + name?: (string|null); + + /** Source displayName */ + displayName?: (string|null); + + /** Source description */ + description?: (string|null); + } + + /** Represents a Source. */ + class Source implements ISource { + + /** + * Constructs a new Source. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1beta1.ISource); + + /** Source name. */ + public name: string; + + /** Source displayName. */ + public displayName: string; + + /** Source description. */ + public description: string; + + /** + * Creates a new Source instance using the specified properties. + * @param [properties] Properties to set + * @returns Source instance + */ + public static create(properties?: google.cloud.securitycenter.v1beta1.ISource): google.cloud.securitycenter.v1beta1.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Source message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1beta1.Source; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1beta1.Source; + + /** + * Verifies a Source message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Source + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1beta1.Source; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1beta1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Source + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1p1beta1. */ + namespace v1p1beta1 { + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset securityCenterProperties */ + securityCenterProperties?: (google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties */ + resourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Asset securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null); + + /** Asset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy|null); + + /** Asset canonicalName */ + canonicalName?: (string|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset securityCenterProperties. */ + public securityCenterProperties?: (google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties|null); + + /** Asset resourceProperties. */ + public resourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Asset securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null); + + /** Asset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy|null); + + /** Asset canonicalName. */ + public canonicalName: string; + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IAsset): google.cloud.securitycenter.v1p1beta1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.Asset; + + /** + * Verifies an Asset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Asset { + + /** Properties of a SecurityCenterProperties. */ + interface ISecurityCenterProperties { + + /** SecurityCenterProperties resourceName */ + resourceName?: (string|null); + + /** SecurityCenterProperties resourceType */ + resourceType?: (string|null); + + /** SecurityCenterProperties resourceParent */ + resourceParent?: (string|null); + + /** SecurityCenterProperties resourceProject */ + resourceProject?: (string|null); + + /** SecurityCenterProperties resourceOwners */ + resourceOwners?: (string[]|null); + + /** SecurityCenterProperties resourceDisplayName */ + resourceDisplayName?: (string|null); + + /** SecurityCenterProperties resourceParentDisplayName */ + resourceParentDisplayName?: (string|null); + + /** SecurityCenterProperties resourceProjectDisplayName */ + resourceProjectDisplayName?: (string|null); + + /** SecurityCenterProperties folders */ + folders?: (google.cloud.securitycenter.v1p1beta1.IFolder[]|null); + } + + /** Represents a SecurityCenterProperties. */ + class SecurityCenterProperties implements ISecurityCenterProperties { + + /** + * Constructs a new SecurityCenterProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties); + + /** SecurityCenterProperties resourceName. */ + public resourceName: string; + + /** SecurityCenterProperties resourceType. */ + public resourceType: string; + + /** SecurityCenterProperties resourceParent. */ + public resourceParent: string; + + /** SecurityCenterProperties resourceProject. */ + public resourceProject: string; + + /** SecurityCenterProperties resourceOwners. */ + public resourceOwners: string[]; + + /** SecurityCenterProperties resourceDisplayName. */ + public resourceDisplayName: string; + + /** SecurityCenterProperties resourceParentDisplayName. */ + public resourceParentDisplayName: string; + + /** SecurityCenterProperties resourceProjectDisplayName. */ + public resourceProjectDisplayName: string; + + /** SecurityCenterProperties folders. */ + public folders: google.cloud.securitycenter.v1p1beta1.IFolder[]; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityCenterProperties instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties): google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @param message SecurityCenterProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties; + + /** + * Verifies a SecurityCenterProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityCenterProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @param message SecurityCenterProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityCenterProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IamPolicy. */ + interface IIamPolicy { + + /** IamPolicy policyBlob */ + policyBlob?: (string|null); + } + + /** Represents an IamPolicy. */ + class IamPolicy implements IIamPolicy { + + /** + * Constructs a new IamPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy); + + /** IamPolicy policyBlob. */ + public policyBlob: string; + + /** + * Creates a new IamPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicy instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy): google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy; + + /** + * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.verify|verify} messages. + * @param message IamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.verify|verify} messages. + * @param message IamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy; + + /** + * Decodes an IamPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy; + + /** + * Verifies an IamPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IamPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy; + + /** + * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. + * @param message IamPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Folder. */ + interface IFolder { + + /** Folder resourceFolder */ + resourceFolder?: (string|null); + + /** Folder resourceFolderDisplayName */ + resourceFolderDisplayName?: (string|null); + } + + /** Represents a Folder. */ + class Folder implements IFolder { + + /** + * Constructs a new Folder. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IFolder); + + /** Folder resourceFolder. */ + public resourceFolder: string; + + /** Folder resourceFolderDisplayName. */ + public resourceFolderDisplayName: string; + + /** + * Creates a new Folder instance using the specified properties. + * @param [properties] Properties to set + * @returns Folder instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IFolder): google.cloud.securitycenter.v1p1beta1.Folder; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.Folder; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.Folder; + + /** + * Verifies a Folder message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Folder message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Folder + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Folder; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @param message Folder + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Folder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Folder to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Folder + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecurityMarks. */ + interface ISecurityMarks { + + /** SecurityMarks name */ + name?: (string|null); + + /** SecurityMarks marks */ + marks?: ({ [k: string]: string }|null); + + /** SecurityMarks canonicalName */ + canonicalName?: (string|null); + } + + /** Represents a SecurityMarks. */ + class SecurityMarks implements ISecurityMarks { + + /** + * Constructs a new SecurityMarks. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ISecurityMarks); + + /** SecurityMarks name. */ + public name: string; + + /** SecurityMarks marks. */ + public marks: { [k: string]: string }; + + /** SecurityMarks canonicalName. */ + public canonicalName: string; + + /** + * Creates a new SecurityMarks instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityMarks instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ISecurityMarks): google.cloud.securitycenter.v1p1beta1.SecurityMarks; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify|verify} messages. + * @param message SecurityMarks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ISecurityMarks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.SecurityMarks; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.SecurityMarks; + + /** + * Verifies a SecurityMarks message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityMarks + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.SecurityMarks; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @param message SecurityMarks + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.SecurityMarks, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityMarks to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityMarks + * @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 parent */ + parent?: (string|null); + + /** Finding resourceName */ + resourceName?: (string|null); + + /** Finding state */ + state?: (google.cloud.securitycenter.v1p1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.State|null); + + /** Finding category */ + category?: (string|null); + + /** Finding externalUri */ + externalUri?: (string|null); + + /** Finding sourceProperties */ + sourceProperties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Finding securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null); + + /** Finding eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Finding severity */ + severity?: (google.cloud.securitycenter.v1p1beta1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.Severity|null); + + /** Finding canonicalName */ + canonicalName?: (string|null); + } + + /** Represents a Finding. */ + class Finding implements IFinding { + + /** + * Constructs a new Finding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IFinding); + + /** Finding name. */ + public name: string; + + /** Finding parent. */ + public parent: string; + + /** Finding resourceName. */ + public resourceName: string; + + /** Finding state. */ + public state: (google.cloud.securitycenter.v1p1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.State); + + /** Finding category. */ + public category: string; + + /** Finding externalUri. */ + public externalUri: string; + + /** Finding sourceProperties. */ + public sourceProperties: { [k: string]: google.protobuf.IValue }; + + /** Finding securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null); + + /** Finding eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** Finding createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Finding severity. */ + public severity: (google.cloud.securitycenter.v1p1beta1.Finding.Severity|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.Severity); + + /** Finding canonicalName. */ + public canonicalName: string; + + /** + * Creates a new Finding instance using the specified properties. + * @param [properties] Properties to set + * @returns Finding instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IFinding): google.cloud.securitycenter.v1p1beta1.Finding; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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 { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2 + } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + CRITICAL = 1, + HIGH = 2, + MEDIUM = 3, + LOW = 4 + } + } + + /** Properties of a NotificationConfig. */ + interface INotificationConfig { + + /** NotificationConfig name */ + name?: (string|null); + + /** NotificationConfig description */ + description?: (string|null); + + /** NotificationConfig eventType */ + eventType?: (google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType|keyof typeof google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType|null); + + /** NotificationConfig pubsubTopic */ + pubsubTopic?: (string|null); + + /** NotificationConfig serviceAccount */ + serviceAccount?: (string|null); + + /** NotificationConfig streamingConfig */ + streamingConfig?: (google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig|null); + } + + /** Represents a NotificationConfig. */ + class NotificationConfig implements INotificationConfig { + + /** + * Constructs a new NotificationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.INotificationConfig); + + /** NotificationConfig name. */ + public name: string; + + /** NotificationConfig description. */ + public description: string; + + /** NotificationConfig eventType. */ + public eventType: (google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType|keyof typeof google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType); + + /** NotificationConfig pubsubTopic. */ + public pubsubTopic: string; + + /** NotificationConfig serviceAccount. */ + public serviceAccount: string; + + /** NotificationConfig streamingConfig. */ + public streamingConfig?: (google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig|null); + + /** NotificationConfig notifyConfig. */ + public notifyConfig?: "streamingConfig"; + + /** + * Creates a new NotificationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.INotificationConfig): google.cloud.securitycenter.v1p1beta1.NotificationConfig; + + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.NotificationConfig; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.NotificationConfig; + + /** + * Verifies a NotificationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.NotificationConfig; + + /** + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @param message NotificationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.NotificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NotificationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NotificationConfig { + + /** Properties of a StreamingConfig. */ + interface IStreamingConfig { + + /** StreamingConfig filter */ + filter?: (string|null); + } + + /** Represents a StreamingConfig. */ + class StreamingConfig implements IStreamingConfig { + + /** + * Constructs a new StreamingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig); + + /** StreamingConfig filter. */ + public filter: string; + + /** + * Creates a new StreamingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig): google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig; + + /** + * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @param message StreamingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @param message StreamingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig; + + /** + * Verifies a StreamingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig; + + /** + * Creates a plain object from a StreamingConfig message. Also converts values to other types if specified. + * @param message StreamingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** EventType enum. */ + enum EventType { + EVENT_TYPE_UNSPECIFIED = 0, + FINDING = 1 + } + } + + /** Properties of a NotificationMessage. */ + interface INotificationMessage { + + /** NotificationMessage notificationConfigName */ + notificationConfigName?: (string|null); + + /** NotificationMessage finding */ + finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + + /** NotificationMessage resource */ + resource?: (google.cloud.securitycenter.v1p1beta1.IResource|null); + } + + /** Represents a NotificationMessage. */ + class NotificationMessage implements INotificationMessage { + + /** + * Constructs a new NotificationMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.INotificationMessage); + + /** NotificationMessage notificationConfigName. */ + public notificationConfigName: string; + + /** NotificationMessage finding. */ + public finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + + /** NotificationMessage resource. */ + public resource?: (google.cloud.securitycenter.v1p1beta1.IResource|null); + + /** NotificationMessage event. */ + public event?: "finding"; + + /** + * Creates a new NotificationMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationMessage instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.INotificationMessage): google.cloud.securitycenter.v1p1beta1.NotificationMessage; + + /** + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationMessage.verify|verify} messages. + * @param message NotificationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.INotificationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationMessage.verify|verify} messages. + * @param message NotificationMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.INotificationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.NotificationMessage; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.NotificationMessage; + + /** + * Verifies a NotificationMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.NotificationMessage; + + /** + * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. + * @param message NotificationMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.NotificationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NotificationMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource name */ + name?: (string|null); + + /** Resource project */ + project?: (string|null); + + /** Resource projectDisplayName */ + projectDisplayName?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource parentDisplayName */ + parentDisplayName?: (string|null); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1p1beta1.IFolder[]|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IResource); + + /** Resource name. */ + public name: string; + + /** Resource project. */ + public project: string; + + /** Resource projectDisplayName. */ + public projectDisplayName: string; + + /** Resource parent. */ + public parent: string; + + /** Resource parentDisplayName. */ + public parentDisplayName: string; + + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1p1beta1.IFolder[]; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IResource): google.cloud.securitycenter.v1p1beta1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.Resource; + + /** + * Verifies a Resource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OrganizationSettings. */ + interface IOrganizationSettings { + + /** OrganizationSettings name */ + name?: (string|null); + + /** OrganizationSettings enableAssetDiscovery */ + enableAssetDiscovery?: (boolean|null); + + /** OrganizationSettings assetDiscoveryConfig */ + assetDiscoveryConfig?: (google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig|null); + } + + /** Represents an OrganizationSettings. */ + class OrganizationSettings implements IOrganizationSettings { + + /** + * Constructs a new OrganizationSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IOrganizationSettings); + + /** OrganizationSettings name. */ + public name: string; + + /** OrganizationSettings enableAssetDiscovery. */ + public enableAssetDiscovery: boolean; + + /** OrganizationSettings assetDiscoveryConfig. */ + public assetDiscoveryConfig?: (google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig|null); + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns OrganizationSettings instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IOrganizationSettings): google.cloud.securitycenter.v1p1beta1.OrganizationSettings; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.verify|verify} messages. + * @param message OrganizationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.OrganizationSettings; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.OrganizationSettings; + + /** + * Verifies an OrganizationSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrganizationSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.OrganizationSettings; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @param message OrganizationSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.OrganizationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrganizationSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrganizationSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OrganizationSettings { + + /** Properties of an AssetDiscoveryConfig. */ + interface IAssetDiscoveryConfig { + + /** AssetDiscoveryConfig projectIds */ + projectIds?: (string[]|null); + + /** AssetDiscoveryConfig inclusionMode */ + inclusionMode?: (google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null); + + /** AssetDiscoveryConfig folderIds */ + folderIds?: (string[]|null); + } + + /** Represents an AssetDiscoveryConfig. */ + class AssetDiscoveryConfig implements IAssetDiscoveryConfig { + + /** + * Constructs a new AssetDiscoveryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig); + + /** AssetDiscoveryConfig projectIds. */ + public projectIds: string[]; + + /** AssetDiscoveryConfig inclusionMode. */ + public inclusionMode: (google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|keyof typeof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode); + + /** AssetDiscoveryConfig folderIds. */ + public folderIds: string[]; + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AssetDiscoveryConfig instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig): google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @param message AssetDiscoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Verifies an AssetDiscoveryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssetDiscoveryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @param message AssetDiscoveryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AssetDiscoveryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AssetDiscoveryConfig { + + /** InclusionMode enum. */ + enum InclusionMode { + INCLUSION_MODE_UNSPECIFIED = 0, + INCLUDE_ONLY = 1, + EXCLUDE = 2 + } + } + } + + /** Properties of a RunAssetDiscoveryResponse. */ + interface IRunAssetDiscoveryResponse { + + /** RunAssetDiscoveryResponse state */ + state?: (google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State|null); + + /** RunAssetDiscoveryResponse duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a RunAssetDiscoveryResponse. */ + class RunAssetDiscoveryResponse implements IRunAssetDiscoveryResponse { + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse); + + /** RunAssetDiscoveryResponse state. */ + public state: (google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State|keyof typeof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State); + + /** RunAssetDiscoveryResponse duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @param message RunAssetDiscoveryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse; + + /** + * Verifies a RunAssetDiscoveryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAssetDiscoveryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RunAssetDiscoveryResponse { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + COMPLETED = 1, + SUPERSEDED = 2, + TERMINATED = 3 + } + } + + /** Represents a SecurityCenter */ + class SecurityCenter extends $protobuf.rpc.Service { + + /** + * Constructs a new SecurityCenter 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 SecurityCenter 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): SecurityCenter; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public createSource(request: google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSourceCallback): void; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @returns Promise + */ + public createSource(request: google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest): Promise; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public createFinding(request: google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFindingCallback): void; + + /** + * Calls CreateFinding. + * @param request CreateFindingRequest message or plain object + * @returns Promise + */ + public createFinding(request: google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest): Promise; + + /** + * Calls CreateNotificationConfig. + * @param request CreateNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationConfig + */ + public createNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfigCallback): void; + + /** + * Calls CreateNotificationConfig. + * @param request CreateNotificationConfigRequest message or plain object + * @returns Promise + */ + public createNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest): Promise; + + /** + * Calls DeleteNotificationConfig. + * @param request DeleteNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfigCallback): void; + + /** + * Calls DeleteNotificationConfig. + * @param request DeleteNotificationConfigRequest message or plain object + * @returns Promise + */ + public deleteNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls GetNotificationConfig. + * @param request GetNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationConfig + */ + public getNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfigCallback): void; + + /** + * Calls GetNotificationConfig. + * @param request GetNotificationConfigRequest message or plain object + * @returns Promise + */ + public getNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest): Promise; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettingsCallback): void; + + /** + * Calls GetOrganizationSettings. + * @param request GetOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public getOrganizationSettings(request: google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest): Promise; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public getSource(request: google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSourceCallback): void; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @returns Promise + */ + public getSource(request: google.cloud.securitycenter.v1p1beta1.IGetSourceRequest): Promise; + + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupAssetsResponse + */ + public groupAssets(request: google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssetsCallback): void; + + /** + * Calls GroupAssets. + * @param request GroupAssetsRequest message or plain object + * @returns Promise + */ + public groupAssets(request: google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest): Promise; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GroupFindingsResponse + */ + public groupFindings(request: google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindingsCallback): void; + + /** + * Calls GroupFindings. + * @param request GroupFindingsRequest message or plain object + * @returns Promise + */ + public groupFindings(request: google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest): Promise; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + */ + public listAssets(request: google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssetsCallback): void; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise + */ + public listAssets(request: google.cloud.securitycenter.v1p1beta1.IListAssetsRequest): 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.securitycenter.v1p1beta1.IListFindingsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindingsCallback): void; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @returns Promise + */ + public listFindings(request: google.cloud.securitycenter.v1p1beta1.IListFindingsRequest): Promise; + + /** + * Calls ListNotificationConfigs. + * @param request ListNotificationConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListNotificationConfigsResponse + */ + public listNotificationConfigs(request: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigsCallback): void; + + /** + * Calls ListNotificationConfigs. + * @param request ListNotificationConfigsRequest message or plain object + * @returns Promise + */ + public listNotificationConfigs(request: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest): Promise; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSourcesResponse + */ + public listSources(request: google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSourcesCallback): void; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @returns Promise + */ + public listSources(request: google.cloud.securitycenter.v1p1beta1.IListSourcesRequest): Promise; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscoveryCallback): void; + + /** + * Calls RunAssetDiscovery. + * @param request RunAssetDiscoveryRequest message or plain object + * @returns Promise + */ + public runAssetDiscovery(request: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest): Promise; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public setFindingState(request: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingStateCallback): void; + + /** + * Calls SetFindingState. + * @param request SetFindingStateRequest message or plain object + * @returns Promise + */ + public setFindingState(request: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public updateFinding(request: google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFindingCallback): void; + + /** + * Calls UpdateFinding. + * @param request UpdateFindingRequest message or plain object + * @returns Promise + */ + public updateFinding(request: google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest): Promise; + + /** + * Calls UpdateNotificationConfig. + * @param request UpdateNotificationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationConfig + */ + public updateNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfigCallback): void; + + /** + * Calls UpdateNotificationConfig. + * @param request UpdateNotificationConfigRequest message or plain object + * @returns Promise + */ + public updateNotificationConfig(request: google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest): Promise; + + /** + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OrganizationSettings + */ + public updateOrganizationSettings(request: google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettingsCallback): void; + + /** + * Calls UpdateOrganizationSettings. + * @param request UpdateOrganizationSettingsRequest message or plain object + * @returns Promise + */ + public updateOrganizationSettings(request: google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest): Promise; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public updateSource(request: google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSourceCallback): void; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @returns Promise + */ + public updateSource(request: google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest): Promise; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityMarks + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, callback: google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarksCallback): void; + + /** + * Calls UpdateSecurityMarks. + * @param request UpdateSecurityMarksRequest message or plain object + * @returns Promise + */ + public updateSecurityMarks(request: google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest): Promise; + } + + namespace SecurityCenter { + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|createSource}. + * @param error Error, if any + * @param [response] Source + */ + type CreateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|createFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type CreateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|createNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type CreateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|deleteNotificationConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteNotificationConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type GetNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type GetOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getSource}. + * @param error Error, if any + * @param [response] Source + */ + type GetSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|groupAssets}. + * @param error Error, if any + * @param [response] GroupAssetsResponse + */ + type GroupAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|groupFindings}. + * @param error Error, if any + * @param [response] GroupFindingsResponse + */ + type GroupFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse + */ + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listFindings}. + * @param error Error, if any + * @param [response] ListFindingsResponse + */ + type ListFindingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listNotificationConfigs}. + * @param error Error, if any + * @param [response] ListNotificationConfigsResponse + */ + type ListNotificationConfigsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listSources}. + * @param error Error, if any + * @param [response] ListSourcesResponse + */ + type ListSourcesCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|runAssetDiscovery}. + * @param error Error, if any + * @param [response] Operation + */ + type RunAssetDiscoveryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|setFindingState}. + * @param error Error, if any + * @param [response] Finding + */ + type SetFindingStateCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type UpdateFindingCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateNotificationConfig}. + * @param error Error, if any + * @param [response] NotificationConfig + */ + type UpdateNotificationConfigCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.NotificationConfig) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateOrganizationSettings}. + * @param error Error, if any + * @param [response] OrganizationSettings + */ + type UpdateOrganizationSettingsCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.OrganizationSettings) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateSource}. + * @param error Error, if any + * @param [response] Source + */ + type UpdateSourceCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.Source) => void; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateSecurityMarks}. + * @param error Error, if any + * @param [response] SecurityMarks + */ + type UpdateSecurityMarksCallback = (error: (Error|null), response?: google.cloud.securitycenter.v1p1beta1.SecurityMarks) => void; + } + + /** Properties of a CreateFindingRequest. */ + interface ICreateFindingRequest { + + /** CreateFindingRequest parent */ + parent?: (string|null); + + /** CreateFindingRequest findingId */ + findingId?: (string|null); + + /** CreateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + } + + /** Represents a CreateFindingRequest. */ + class CreateFindingRequest implements ICreateFindingRequest { + + /** + * Constructs a new CreateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest); + + /** CreateFindingRequest parent. */ + public parent: string; + + /** CreateFindingRequest findingId. */ + public findingId: string; + + /** CreateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFindingRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest): google.cloud.securitycenter.v1p1beta1.CreateFindingRequest; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.verify|verify} messages. + * @param message CreateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.CreateFindingRequest; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.CreateFindingRequest; + + /** + * Verifies a CreateFindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.CreateFindingRequest; + + /** + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @param message CreateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.CreateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateNotificationConfigRequest. */ + interface ICreateNotificationConfigRequest { + + /** CreateNotificationConfigRequest parent */ + parent?: (string|null); + + /** CreateNotificationConfigRequest configId */ + configId?: (string|null); + + /** CreateNotificationConfigRequest notificationConfig */ + notificationConfig?: (google.cloud.securitycenter.v1p1beta1.INotificationConfig|null); + } + + /** Represents a CreateNotificationConfigRequest. */ + class CreateNotificationConfigRequest implements ICreateNotificationConfigRequest { + + /** + * Constructs a new CreateNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest); + + /** CreateNotificationConfigRequest parent. */ + public parent: string; + + /** CreateNotificationConfigRequest configId. */ + public configId: string; + + /** CreateNotificationConfigRequest notificationConfig. */ + public notificationConfig?: (google.cloud.securitycenter.v1p1beta1.INotificationConfig|null); + + /** + * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest): google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest; + + /** + * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.verify|verify} messages. + * @param message CreateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.verify|verify} messages. + * @param message CreateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest; + + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest; + + /** + * Verifies a CreateNotificationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest; + + /** + * Creates a plain object from a CreateNotificationConfigRequest message. Also converts values to other types if specified. + * @param message CreateNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSourceRequest. */ + interface ICreateSourceRequest { + + /** CreateSourceRequest parent */ + parent?: (string|null); + + /** CreateSourceRequest source */ + source?: (google.cloud.securitycenter.v1p1beta1.ISource|null); + } + + /** Represents a CreateSourceRequest. */ + class CreateSourceRequest implements ICreateSourceRequest { + + /** + * Constructs a new CreateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest); + + /** CreateSourceRequest parent. */ + public parent: string; + + /** CreateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1p1beta1.ISource|null); + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest): google.cloud.securitycenter.v1p1beta1.CreateSourceRequest; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.CreateSourceRequest; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.CreateSourceRequest; + + /** + * Verifies a CreateSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.CreateSourceRequest; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @param message CreateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteNotificationConfigRequest. */ + interface IDeleteNotificationConfigRequest { + + /** DeleteNotificationConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteNotificationConfigRequest. */ + class DeleteNotificationConfigRequest implements IDeleteNotificationConfigRequest { + + /** + * Constructs a new DeleteNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest); + + /** DeleteNotificationConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest): google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest; + + /** + * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest.verify|verify} messages. + * @param message DeleteNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest.verify|verify} messages. + * @param message DeleteNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest; + + /** + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest; + + /** + * Verifies a DeleteNotificationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest; + + /** + * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. + * @param message DeleteNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetNotificationConfigRequest. */ + interface IGetNotificationConfigRequest { + + /** GetNotificationConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetNotificationConfigRequest. */ + class GetNotificationConfigRequest implements IGetNotificationConfigRequest { + + /** + * Constructs a new GetNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest); + + /** GetNotificationConfigRequest name. */ + public name: string; + + /** + * Creates a new GetNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest): google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest; + + /** + * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest.verify|verify} messages. + * @param message GetNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest.verify|verify} messages. + * @param message GetNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest; + + /** + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest; + + /** + * Verifies a GetNotificationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest; + + /** + * Creates a plain object from a GetNotificationConfigRequest message. Also converts values to other types if specified. + * @param message GetNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOrganizationSettingsRequest. */ + interface IGetOrganizationSettingsRequest { + + /** GetOrganizationSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetOrganizationSettingsRequest. */ + class GetOrganizationSettingsRequest implements IGetOrganizationSettingsRequest { + + /** + * Constructs a new GetOrganizationSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest); + + /** GetOrganizationSettingsRequest name. */ + public name: string; + + /** + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOrganizationSettingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest): google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest; + + /** + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @param message GetOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest; + + /** + * Verifies a GetOrganizationSettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOrganizationSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest; + + /** + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message GetOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOrganizationSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOrganizationSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSourceRequest. */ + interface IGetSourceRequest { + + /** GetSourceRequest name */ + name?: (string|null); + } + + /** Represents a GetSourceRequest. */ + class GetSourceRequest implements IGetSourceRequest { + + /** + * Constructs a new GetSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGetSourceRequest); + + /** GetSourceRequest name. */ + public name: string; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGetSourceRequest): google.cloud.securitycenter.v1p1beta1.GetSourceRequest; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.GetSourceRequest; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.GetSourceRequest; + + /** + * Verifies a GetSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GetSourceRequest; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @param message GetSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GetSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupAssetsRequest. */ + interface IGroupAssetsRequest { + + /** GroupAssetsRequest parent */ + parent?: (string|null); + + /** GroupAssetsRequest filter */ + filter?: (string|null); + + /** GroupAssetsRequest groupBy */ + groupBy?: (string|null); + + /** GroupAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest pageToken */ + pageToken?: (string|null); + + /** GroupAssetsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a GroupAssetsRequest. */ + class GroupAssetsRequest implements IGroupAssetsRequest { + + /** + * Constructs a new GroupAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest); + + /** GroupAssetsRequest parent. */ + public parent: string; + + /** GroupAssetsRequest filter. */ + public filter: string; + + /** GroupAssetsRequest groupBy. */ + public groupBy: string; + + /** GroupAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** GroupAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsRequest pageToken. */ + public pageToken: string; + + /** GroupAssetsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest): google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest; + + /** + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.verify|verify} messages. + * @param message GroupAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest; + + /** + * Verifies a GroupAssetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest; + + /** + * Creates a plain object from a GroupAssetsRequest message. Also converts values to other types if specified. + * @param message GroupAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupAssetsResponse. */ + interface IGroupAssetsResponse { + + /** GroupAssetsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1p1beta1.IGroupResult[]|null); + + /** GroupAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** GroupAssetsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a GroupAssetsResponse. */ + class GroupAssetsResponse implements IGroupAssetsResponse { + + /** + * Constructs a new GroupAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse); + + /** GroupAssetsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1p1beta1.IGroupResult[]; + + /** GroupAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** GroupAssetsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupAssetsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse): google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse; + + /** + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.verify|verify} messages. + * @param message GroupAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse; + + /** + * Verifies a GroupAssetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse; + + /** + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @param message GroupAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupFindingsRequest. */ + interface IGroupFindingsRequest { + + /** GroupFindingsRequest parent */ + parent?: (string|null); + + /** GroupFindingsRequest filter */ + filter?: (string|null); + + /** GroupFindingsRequest groupBy */ + groupBy?: (string|null); + + /** GroupFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** GroupFindingsRequest pageToken */ + pageToken?: (string|null); + + /** GroupFindingsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a GroupFindingsRequest. */ + class GroupFindingsRequest implements IGroupFindingsRequest { + + /** + * Constructs a new GroupFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest); + + /** GroupFindingsRequest parent. */ + public parent: string; + + /** GroupFindingsRequest filter. */ + public filter: string; + + /** GroupFindingsRequest groupBy. */ + public groupBy: string; + + /** GroupFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** GroupFindingsRequest pageToken. */ + public pageToken: string; + + /** GroupFindingsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest): google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.verify|verify} messages. + * @param message GroupFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest; + + /** + * Verifies a GroupFindingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest; + + /** + * Creates a plain object from a GroupFindingsRequest message. Also converts values to other types if specified. + * @param message GroupFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupFindingsResponse. */ + interface IGroupFindingsResponse { + + /** GroupFindingsResponse groupByResults */ + groupByResults?: (google.cloud.securitycenter.v1p1beta1.IGroupResult[]|null); + + /** GroupFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** GroupFindingsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a GroupFindingsResponse. */ + class GroupFindingsResponse implements IGroupFindingsResponse { + + /** + * Constructs a new GroupFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse); + + /** GroupFindingsResponse groupByResults. */ + public groupByResults: google.cloud.securitycenter.v1p1beta1.IGroupResult[]; + + /** GroupFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** GroupFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** GroupFindingsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse): google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.verify|verify} messages. + * @param message GroupFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse; + + /** + * Verifies a GroupFindingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @param message GroupFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupResult. */ + interface IGroupResult { + + /** GroupResult properties */ + properties?: ({ [k: string]: google.protobuf.IValue }|null); + + /** GroupResult count */ + count?: (number|Long|string|null); + } + + /** Represents a GroupResult. */ + class GroupResult implements IGroupResult { + + /** + * Constructs a new GroupResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IGroupResult); + + /** GroupResult properties. */ + public properties: { [k: string]: google.protobuf.IValue }; + + /** GroupResult count. */ + public count: (number|Long|string); + + /** + * Creates a new GroupResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IGroupResult): google.cloud.securitycenter.v1p1beta1.GroupResult; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupResult.verify|verify} messages. + * @param message GroupResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IGroupResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.GroupResult; + + /** + * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.GroupResult; + + /** + * Verifies a GroupResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.GroupResult; + + /** + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @param message GroupResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.GroupResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListNotificationConfigsRequest. */ + interface IListNotificationConfigsRequest { + + /** ListNotificationConfigsRequest parent */ + parent?: (string|null); + + /** ListNotificationConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListNotificationConfigsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListNotificationConfigsRequest. */ + class ListNotificationConfigsRequest implements IListNotificationConfigsRequest { + + /** + * Constructs a new ListNotificationConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest); + + /** ListNotificationConfigsRequest parent. */ + public parent: string; + + /** ListNotificationConfigsRequest pageToken. */ + public pageToken: string; + + /** ListNotificationConfigsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListNotificationConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNotificationConfigsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest): google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest; + + /** + * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.verify|verify} messages. + * @param message ListNotificationConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNotificationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.verify|verify} messages. + * @param message ListNotificationConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNotificationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNotificationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest; + + /** + * Verifies a ListNotificationConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNotificationConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest; + + /** + * Creates a plain object from a ListNotificationConfigsRequest message. Also converts values to other types if specified. + * @param message ListNotificationConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNotificationConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNotificationConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListNotificationConfigsResponse. */ + interface IListNotificationConfigsResponse { + + /** ListNotificationConfigsResponse notificationConfigs */ + notificationConfigs?: (google.cloud.securitycenter.v1p1beta1.INotificationConfig[]|null); + + /** ListNotificationConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListNotificationConfigsResponse. */ + class ListNotificationConfigsResponse implements IListNotificationConfigsResponse { + + /** + * Constructs a new ListNotificationConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse); + + /** ListNotificationConfigsResponse notificationConfigs. */ + public notificationConfigs: google.cloud.securitycenter.v1p1beta1.INotificationConfig[]; + + /** ListNotificationConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListNotificationConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNotificationConfigsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse): google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse; + + /** + * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.verify|verify} messages. + * @param message ListNotificationConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNotificationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.verify|verify} messages. + * @param message ListNotificationConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNotificationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNotificationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse; + + /** + * Verifies a ListNotificationConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNotificationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNotificationConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse; + + /** + * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. + * @param message ListNotificationConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNotificationConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNotificationConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSourcesRequest. */ + interface IListSourcesRequest { + + /** ListSourcesRequest parent */ + parent?: (string|null); + + /** ListSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListSourcesRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListSourcesRequest. */ + class ListSourcesRequest implements IListSourcesRequest { + + /** + * Constructs a new ListSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListSourcesRequest); + + /** ListSourcesRequest parent. */ + public parent: string; + + /** ListSourcesRequest pageToken. */ + public pageToken: string; + + /** ListSourcesRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListSourcesRequest): google.cloud.securitycenter.v1p1beta1.ListSourcesRequest; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.ListSourcesRequest; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.ListSourcesRequest; + + /** + * Verifies a ListSourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListSourcesRequest; + + /** + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * @param message ListSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSourcesResponse. */ + interface IListSourcesResponse { + + /** ListSourcesResponse sources */ + sources?: (google.cloud.securitycenter.v1p1beta1.ISource[]|null); + + /** ListSourcesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSourcesResponse. */ + class ListSourcesResponse implements IListSourcesResponse { + + /** + * Constructs a new ListSourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListSourcesResponse); + + /** ListSourcesResponse sources. */ + public sources: google.cloud.securitycenter.v1p1beta1.ISource[]; + + /** ListSourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListSourcesResponse): google.cloud.securitycenter.v1p1beta1.ListSourcesResponse; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.ListSourcesResponse; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.ListSourcesResponse; + + /** + * Verifies a ListSourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListSourcesResponse; + + /** + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @param message ListSourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { + + /** ListAssetsRequest parent */ + parent?: (string|null); + + /** ListAssetsRequest filter */ + filter?: (string|null); + + /** ListAssetsRequest orderBy */ + orderBy?: (string|null); + + /** ListAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** ListAssetsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); + + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { + + /** + * Constructs a new ListAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListAssetsRequest); + + /** ListAssetsRequest parent. */ + public parent: string; + + /** ListAssetsRequest filter. */ + public filter: string; + + /** ListAssetsRequest orderBy. */ + public orderBy: string; + + /** ListAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** ListAssetsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListAssetsRequest pageToken. */ + public pageToken: string; + + /** ListAssetsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListAssetsRequest): google.cloud.securitycenter.v1p1beta1.ListAssetsRequest; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.ListAssetsRequest; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.ListAssetsRequest; + + /** + * Verifies a ListAssetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListAssetsRequest; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { + + /** ListAssetsResponse listAssetsResults */ + listAssetsResults?: (google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[]|null); + + /** ListAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAssetsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { + + /** + * Constructs a new ListAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListAssetsResponse); + + /** ListAssetsResponse listAssetsResults. */ + public listAssetsResults: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[]; + + /** ListAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAssetsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListAssetsResponse): google.cloud.securitycenter.v1p1beta1.ListAssetsResponse; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.ListAssetsResponse; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.ListAssetsResponse; + + /** + * Verifies a ListAssetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListAssetsResponse; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListAssetsResponse { + + /** Properties of a ListAssetsResult. */ + interface IListAssetsResult { + + /** ListAssetsResult asset */ + asset?: (google.cloud.securitycenter.v1p1beta1.IAsset|null); + + /** ListAssetsResult stateChange */ + stateChange?: (google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange|keyof typeof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange|null); + } + + /** Represents a ListAssetsResult. */ + class ListAssetsResult implements IListAssetsResult { + + /** + * Constructs a new ListAssetsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult); + + /** ListAssetsResult asset. */ + public asset?: (google.cloud.securitycenter.v1p1beta1.IAsset|null); + + /** ListAssetsResult stateChange. */ + public stateChange: (google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange|keyof typeof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange); + + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult): google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @param message ListAssetsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Verifies a ListAssetsResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @param message ListAssetsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListAssetsResult { + + /** StateChange enum. */ + enum StateChange { + UNUSED = 0, + ADDED = 1, + REMOVED = 2, + ACTIVE = 3 + } + } + } + + /** Properties of a ListFindingsRequest. */ + interface IListFindingsRequest { + + /** ListFindingsRequest parent */ + parent?: (string|null); + + /** ListFindingsRequest filter */ + filter?: (string|null); + + /** ListFindingsRequest orderBy */ + orderBy?: (string|null); + + /** ListFindingsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest compareDuration */ + compareDuration?: (google.protobuf.IDuration|null); + + /** ListFindingsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|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.securitycenter.v1p1beta1.IListFindingsRequest); + + /** ListFindingsRequest parent. */ + public parent: string; + + /** ListFindingsRequest filter. */ + public filter: string; + + /** ListFindingsRequest orderBy. */ + public orderBy: string; + + /** ListFindingsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsRequest compareDuration. */ + public compareDuration?: (google.protobuf.IDuration|null); + + /** ListFindingsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** 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.securitycenter.v1p1beta1.IListFindingsRequest): google.cloud.securitycenter.v1p1beta1.ListFindingsRequest; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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 listFindingsResults */ + listFindingsResults?: (google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[]|null); + + /** ListFindingsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListFindingsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListFindingsResponse. */ + class ListFindingsResponse implements IListFindingsResponse { + + /** + * Constructs a new ListFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IListFindingsResponse); + + /** ListFindingsResponse listFindingsResults. */ + public listFindingsResults: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[]; + + /** ListFindingsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListFindingsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResponse instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IListFindingsResponse): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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; + } + + namespace ListFindingsResponse { + + /** Properties of a ListFindingsResult. */ + interface IListFindingsResult { + + /** ListFindingsResult finding */ + finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + + /** ListFindingsResult stateChange */ + stateChange?: (google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange|keyof typeof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange|null); + + /** ListFindingsResult resource */ + resource?: (google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource|null); + } + + /** Represents a ListFindingsResult. */ + class ListFindingsResult implements IListFindingsResult { + + /** + * Constructs a new ListFindingsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult); + + /** ListFindingsResult finding. */ + public finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + + /** ListFindingsResult stateChange. */ + public stateChange: (google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange|keyof typeof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange); + + /** ListFindingsResult resource. */ + public resource?: (google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource|null); + + /** + * Creates a new ListFindingsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResult instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult; + + /** + * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @param message ListFindingsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @param message ListFindingsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult; + + /** + * Verifies a ListFindingsResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult; + + /** + * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. + * @param message ListFindingsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListFindingsResult { + + /** Properties of a Resource. */ + interface IResource { + + /** Resource name */ + name?: (string|null); + + /** Resource projectName */ + projectName?: (string|null); + + /** Resource projectDisplayName */ + projectDisplayName?: (string|null); + + /** Resource parentName */ + parentName?: (string|null); + + /** Resource parentDisplayName */ + parentDisplayName?: (string|null); + + /** Resource folders */ + folders?: (google.cloud.securitycenter.v1p1beta1.IFolder[]|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource); + + /** Resource name. */ + public name: string; + + /** Resource projectName. */ + public projectName: string; + + /** Resource projectDisplayName. */ + public projectDisplayName: string; + + /** Resource parentName. */ + public parentName: string; + + /** Resource parentDisplayName. */ + public parentDisplayName: string; + + /** Resource folders. */ + public folders: google.cloud.securitycenter.v1p1beta1.IFolder[]; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Verifies a Resource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** StateChange enum. */ + enum StateChange { + UNUSED = 0, + CHANGED = 1, + UNCHANGED = 2, + ADDED = 3, + REMOVED = 4 + } + } + } + + /** Properties of a SetFindingStateRequest. */ + interface ISetFindingStateRequest { + + /** SetFindingStateRequest name */ + name?: (string|null); + + /** SetFindingStateRequest state */ + state?: (google.cloud.securitycenter.v1p1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.State|null); + + /** SetFindingStateRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SetFindingStateRequest. */ + class SetFindingStateRequest implements ISetFindingStateRequest { + + /** + * Constructs a new SetFindingStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest); + + /** SetFindingStateRequest name. */ + public name: string; + + /** SetFindingStateRequest state. */ + public state: (google.cloud.securitycenter.v1p1beta1.Finding.State|keyof typeof google.cloud.securitycenter.v1p1beta1.Finding.State); + + /** SetFindingStateRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetFindingStateRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest): google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.verify|verify} messages. + * @param message SetFindingStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest; + + /** + * Verifies a SetFindingStateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetFindingStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @param message SetFindingStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetFindingStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunAssetDiscoveryRequest. */ + interface IRunAssetDiscoveryRequest { + + /** RunAssetDiscoveryRequest parent */ + parent?: (string|null); + } + + /** Represents a RunAssetDiscoveryRequest. */ + class RunAssetDiscoveryRequest implements IRunAssetDiscoveryRequest { + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest); + + /** RunAssetDiscoveryRequest parent. */ + public parent: string; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAssetDiscoveryRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @param message RunAssetDiscoveryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest; + + /** + * Verifies a RunAssetDiscoveryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAssetDiscoveryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @param message RunAssetDiscoveryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunAssetDiscoveryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunAssetDiscoveryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateFindingRequest. */ + interface IUpdateFindingRequest { + + /** UpdateFindingRequest finding */ + finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + + /** UpdateFindingRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFindingRequest. */ + class UpdateFindingRequest implements IUpdateFindingRequest { + + /** + * Constructs a new UpdateFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest); + + /** UpdateFindingRequest finding. */ + public finding?: (google.cloud.securitycenter.v1p1beta1.IFinding|null); + + /** UpdateFindingRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFindingRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest): google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.verify|verify} messages. + * @param message UpdateFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest; + + /** + * Verifies an UpdateFindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @param message UpdateFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateNotificationConfigRequest. */ + interface IUpdateNotificationConfigRequest { + + /** UpdateNotificationConfigRequest notificationConfig */ + notificationConfig?: (google.cloud.securitycenter.v1p1beta1.INotificationConfig|null); + + /** UpdateNotificationConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateNotificationConfigRequest. */ + class UpdateNotificationConfigRequest implements IUpdateNotificationConfigRequest { + + /** + * Constructs a new UpdateNotificationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest); + + /** UpdateNotificationConfigRequest notificationConfig. */ + public notificationConfig?: (google.cloud.securitycenter.v1p1beta1.INotificationConfig|null); + + /** UpdateNotificationConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateNotificationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateNotificationConfigRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest): google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest; + + /** + * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.verify|verify} messages. + * @param message UpdateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.verify|verify} messages. + * @param message UpdateNotificationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest; + + /** + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest; + + /** + * Verifies an UpdateNotificationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateNotificationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest; + + /** + * Creates a plain object from an UpdateNotificationConfigRequest message. Also converts values to other types if specified. + * @param message UpdateNotificationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateNotificationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateNotificationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateOrganizationSettingsRequest. */ + interface IUpdateOrganizationSettingsRequest { + + /** UpdateOrganizationSettingsRequest organizationSettings */ + organizationSettings?: (google.cloud.securitycenter.v1p1beta1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateOrganizationSettingsRequest. */ + class UpdateOrganizationSettingsRequest implements IUpdateOrganizationSettingsRequest { + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest); + + /** UpdateOrganizationSettingsRequest organizationSettings. */ + public organizationSettings?: (google.cloud.securitycenter.v1p1beta1.IOrganizationSettings|null); + + /** UpdateOrganizationSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOrganizationSettingsRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest): google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @param message UpdateOrganizationSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest; + + /** + * Verifies an UpdateOrganizationSettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOrganizationSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateOrganizationSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateOrganizationSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSourceRequest. */ + interface IUpdateSourceRequest { + + /** UpdateSourceRequest source */ + source?: (google.cloud.securitycenter.v1p1beta1.ISource|null); + + /** UpdateSourceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSourceRequest. */ + class UpdateSourceRequest implements IUpdateSourceRequest { + + /** + * Constructs a new UpdateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest); + + /** UpdateSourceRequest source. */ + public source?: (google.cloud.securitycenter.v1p1beta1.ISource|null); + + /** UpdateSourceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSourceRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest): google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest; + + /** + * Verifies an UpdateSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @param message UpdateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSecurityMarksRequest. */ + interface IUpdateSecurityMarksRequest { + + /** UpdateSecurityMarksRequest securityMarks */ + securityMarks?: (google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateSecurityMarksRequest. */ + class UpdateSecurityMarksRequest implements IUpdateSecurityMarksRequest { + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest); + + /** UpdateSecurityMarksRequest securityMarks. */ + public securityMarks?: (google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null); + + /** UpdateSecurityMarksRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSecurityMarksRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSecurityMarksRequest instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest): google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @param message UpdateSecurityMarksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest; + + /** + * Verifies an UpdateSecurityMarksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSecurityMarksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @param message UpdateSecurityMarksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSecurityMarksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Source. */ + interface ISource { + + /** Source name */ + name?: (string|null); + + /** Source displayName */ + displayName?: (string|null); + + /** Source description */ + description?: (string|null); + + /** Source canonicalName */ + canonicalName?: (string|null); + } + + /** Represents a Source. */ + class Source implements ISource { + + /** + * Constructs a new Source. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1p1beta1.ISource); + + /** Source name. */ + public name: string; + + /** Source displayName. */ + public displayName: string; + + /** Source description. */ + public description: string; + + /** Source canonicalName. */ + public canonicalName: string; + + /** + * Creates a new Source instance using the specified properties. + * @param [properties] Properties to set + * @returns Source instance + */ + public static create(properties?: google.cloud.securitycenter.v1p1beta1.ISource): google.cloud.securitycenter.v1p1beta1.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1p1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1p1beta1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Source message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1p1beta1.Source; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1p1beta1.Source; + + /** + * Verifies a Source message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Source + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1p1beta1.Source; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1p1beta1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Source + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** 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; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|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); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { + + /** + * Constructs a new IAMPolicy 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 IAMPolicy 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): IAMPolicy; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { + + /** SetIamPolicyRequest resource */ + resource?: (string|null); + + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { + + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + + /** SetIamPolicyRequest resource. */ + public resource: string; + + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + + /** + * Verifies a SetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { + + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } + + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { + + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + + /** + * Verifies a GetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { + + /** TestIamPermissionsRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + + /** TestIamPermissionsRequest resource. */ + public resource: string; + + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + + /** + * Verifies a TestIamPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { + + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + + /** + * Verifies a TestIamPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { + + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); + + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; + + /** + * Verifies a GetPolicyOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js new file mode 100644 index 00000000000..f795d9fc918 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -0,0 +1,72173 @@ +// 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_security_center_protos || ($protobuf.roots._google_cloud_security_center_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.securitycenter = (function() { + + /** + * Namespace securitycenter. + * @memberof google.cloud + * @namespace + */ + var securitycenter = {}; + + securitycenter.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.securitycenter + * @namespace + */ + var v1 = {}; + + v1.Access = (function() { + + /** + * Properties of an Access. + * @memberof google.cloud.securitycenter.v1 + * @interface IAccess + * @property {string|null} [principalEmail] Access principalEmail + * @property {string|null} [callerIp] Access callerIp + * @property {google.cloud.securitycenter.v1.IGeolocation|null} [callerIpGeo] Access callerIpGeo + * @property {string|null} [userAgentFamily] Access userAgentFamily + * @property {string|null} [serviceName] Access serviceName + * @property {string|null} [methodName] Access methodName + * @property {string|null} [principalSubject] Access principalSubject + * @property {string|null} [serviceAccountKeyName] Access serviceAccountKeyName + * @property {Array.|null} [serviceAccountDelegationInfo] Access serviceAccountDelegationInfo + */ + + /** + * Constructs a new Access. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an Access. + * @implements IAccess + * @constructor + * @param {google.cloud.securitycenter.v1.IAccess=} [properties] Properties to set + */ + function Access(properties) { + this.serviceAccountDelegationInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Access principalEmail. + * @member {string} principalEmail + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.principalEmail = ""; + + /** + * Access callerIp. + * @member {string} callerIp + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.callerIp = ""; + + /** + * Access callerIpGeo. + * @member {google.cloud.securitycenter.v1.IGeolocation|null|undefined} callerIpGeo + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.callerIpGeo = null; + + /** + * Access userAgentFamily. + * @member {string} userAgentFamily + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.userAgentFamily = ""; + + /** + * Access serviceName. + * @member {string} serviceName + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.serviceName = ""; + + /** + * Access methodName. + * @member {string} methodName + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.methodName = ""; + + /** + * Access principalSubject. + * @member {string} principalSubject + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.principalSubject = ""; + + /** + * Access serviceAccountKeyName. + * @member {string} serviceAccountKeyName + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.serviceAccountKeyName = ""; + + /** + * Access serviceAccountDelegationInfo. + * @member {Array.} serviceAccountDelegationInfo + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.serviceAccountDelegationInfo = $util.emptyArray; + + /** + * Creates a new Access instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {google.cloud.securitycenter.v1.IAccess=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Access} Access instance + */ + Access.create = function create(properties) { + return new Access(properties); + }; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.securitycenter.v1.Access.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {google.cloud.securitycenter.v1.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.principalEmail != null && Object.hasOwnProperty.call(message, "principalEmail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.principalEmail); + if (message.callerIp != null && Object.hasOwnProperty.call(message, "callerIp")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.callerIp); + if (message.callerIpGeo != null && Object.hasOwnProperty.call(message, "callerIpGeo")) + $root.google.cloud.securitycenter.v1.Geolocation.encode(message.callerIpGeo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.userAgentFamily != null && Object.hasOwnProperty.call(message, "userAgentFamily")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.userAgentFamily); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceName); + if (message.methodName != null && Object.hasOwnProperty.call(message, "methodName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.methodName); + if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.principalSubject); + if (message.serviceAccountKeyName != null && Object.hasOwnProperty.call(message, "serviceAccountKeyName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.serviceAccountKeyName); + if (message.serviceAccountDelegationInfo != null && message.serviceAccountDelegationInfo.length) + for (var i = 0; i < message.serviceAccountDelegationInfo.length; ++i) + $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.encode(message.serviceAccountDelegationInfo[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Access.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {google.cloud.securitycenter.v1.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Access message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Access(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.principalEmail = reader.string(); + break; + } + case 2: { + message.callerIp = reader.string(); + break; + } + case 3: { + message.callerIpGeo = $root.google.cloud.securitycenter.v1.Geolocation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.userAgentFamily = reader.string(); + break; + } + case 5: { + message.serviceName = reader.string(); + break; + } + case 6: { + message.methodName = reader.string(); + break; + } + case 7: { + message.principalSubject = reader.string(); + break; + } + case 8: { + message.serviceAccountKeyName = reader.string(); + break; + } + case 9: { + if (!(message.serviceAccountDelegationInfo && message.serviceAccountDelegationInfo.length)) + message.serviceAccountDelegationInfo = []; + message.serviceAccountDelegationInfo.push($root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Access message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Access.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + if (!$util.isString(message.principalEmail)) + return "principalEmail: string expected"; + if (message.callerIp != null && message.hasOwnProperty("callerIp")) + if (!$util.isString(message.callerIp)) + return "callerIp: string expected"; + if (message.callerIpGeo != null && message.hasOwnProperty("callerIpGeo")) { + var error = $root.google.cloud.securitycenter.v1.Geolocation.verify(message.callerIpGeo); + if (error) + return "callerIpGeo." + error; + } + if (message.userAgentFamily != null && message.hasOwnProperty("userAgentFamily")) + if (!$util.isString(message.userAgentFamily)) + return "userAgentFamily: string expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.methodName != null && message.hasOwnProperty("methodName")) + if (!$util.isString(message.methodName)) + return "methodName: string expected"; + if (message.principalSubject != null && message.hasOwnProperty("principalSubject")) + if (!$util.isString(message.principalSubject)) + return "principalSubject: string expected"; + if (message.serviceAccountKeyName != null && message.hasOwnProperty("serviceAccountKeyName")) + if (!$util.isString(message.serviceAccountKeyName)) + return "serviceAccountKeyName: string expected"; + if (message.serviceAccountDelegationInfo != null && message.hasOwnProperty("serviceAccountDelegationInfo")) { + if (!Array.isArray(message.serviceAccountDelegationInfo)) + return "serviceAccountDelegationInfo: array expected"; + for (var i = 0; i < message.serviceAccountDelegationInfo.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify(message.serviceAccountDelegationInfo[i]); + if (error) + return "serviceAccountDelegationInfo." + error; + } + } + return null; + }; + + /** + * Creates an Access message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Access} Access + */ + Access.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Access) + return object; + var message = new $root.google.cloud.securitycenter.v1.Access(); + if (object.principalEmail != null) + message.principalEmail = String(object.principalEmail); + if (object.callerIp != null) + message.callerIp = String(object.callerIp); + if (object.callerIpGeo != null) { + if (typeof object.callerIpGeo !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Access.callerIpGeo: object expected"); + message.callerIpGeo = $root.google.cloud.securitycenter.v1.Geolocation.fromObject(object.callerIpGeo); + } + if (object.userAgentFamily != null) + message.userAgentFamily = String(object.userAgentFamily); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.methodName != null) + message.methodName = String(object.methodName); + if (object.principalSubject != null) + message.principalSubject = String(object.principalSubject); + if (object.serviceAccountKeyName != null) + message.serviceAccountKeyName = String(object.serviceAccountKeyName); + if (object.serviceAccountDelegationInfo) { + if (!Array.isArray(object.serviceAccountDelegationInfo)) + throw TypeError(".google.cloud.securitycenter.v1.Access.serviceAccountDelegationInfo: array expected"); + message.serviceAccountDelegationInfo = []; + for (var i = 0; i < object.serviceAccountDelegationInfo.length; ++i) { + if (typeof object.serviceAccountDelegationInfo[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Access.serviceAccountDelegationInfo: object expected"); + message.serviceAccountDelegationInfo[i] = $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.fromObject(object.serviceAccountDelegationInfo[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {google.cloud.securitycenter.v1.Access} message Access + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Access.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serviceAccountDelegationInfo = []; + if (options.defaults) { + object.principalEmail = ""; + object.callerIp = ""; + object.callerIpGeo = null; + object.userAgentFamily = ""; + object.serviceName = ""; + object.methodName = ""; + object.principalSubject = ""; + object.serviceAccountKeyName = ""; + } + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + object.principalEmail = message.principalEmail; + if (message.callerIp != null && message.hasOwnProperty("callerIp")) + object.callerIp = message.callerIp; + if (message.callerIpGeo != null && message.hasOwnProperty("callerIpGeo")) + object.callerIpGeo = $root.google.cloud.securitycenter.v1.Geolocation.toObject(message.callerIpGeo, options); + if (message.userAgentFamily != null && message.hasOwnProperty("userAgentFamily")) + object.userAgentFamily = message.userAgentFamily; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.methodName != null && message.hasOwnProperty("methodName")) + object.methodName = message.methodName; + if (message.principalSubject != null && message.hasOwnProperty("principalSubject")) + object.principalSubject = message.principalSubject; + if (message.serviceAccountKeyName != null && message.hasOwnProperty("serviceAccountKeyName")) + object.serviceAccountKeyName = message.serviceAccountKeyName; + if (message.serviceAccountDelegationInfo && message.serviceAccountDelegationInfo.length) { + object.serviceAccountDelegationInfo = []; + for (var j = 0; j < message.serviceAccountDelegationInfo.length; ++j) + object.serviceAccountDelegationInfo[j] = $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.toObject(message.serviceAccountDelegationInfo[j], options); + } + return object; + }; + + /** + * Converts this Access to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Access + * @instance + * @returns {Object.} JSON object + */ + Access.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Access + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Access + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Access.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Access"; + }; + + return Access; + })(); + + v1.ServiceAccountDelegationInfo = (function() { + + /** + * Properties of a ServiceAccountDelegationInfo. + * @memberof google.cloud.securitycenter.v1 + * @interface IServiceAccountDelegationInfo + * @property {string|null} [principalEmail] ServiceAccountDelegationInfo principalEmail + * @property {string|null} [principalSubject] ServiceAccountDelegationInfo principalSubject + */ + + /** + * Constructs a new ServiceAccountDelegationInfo. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ServiceAccountDelegationInfo. + * @implements IServiceAccountDelegationInfo + * @constructor + * @param {google.cloud.securitycenter.v1.IServiceAccountDelegationInfo=} [properties] Properties to set + */ + function ServiceAccountDelegationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccountDelegationInfo principalEmail. + * @member {string} principalEmail + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @instance + */ + ServiceAccountDelegationInfo.prototype.principalEmail = ""; + + /** + * ServiceAccountDelegationInfo principalSubject. + * @member {string} principalSubject + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @instance + */ + ServiceAccountDelegationInfo.prototype.principalSubject = ""; + + /** + * Creates a new ServiceAccountDelegationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v1.IServiceAccountDelegationInfo=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo instance + */ + ServiceAccountDelegationInfo.create = function create(properties) { + return new ServiceAccountDelegationInfo(properties); + }; + + /** + * Encodes the specified ServiceAccountDelegationInfo message. Does not implicitly {@link google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v1.IServiceAccountDelegationInfo} message ServiceAccountDelegationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountDelegationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.principalEmail != null && Object.hasOwnProperty.call(message, "principalEmail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.principalEmail); + if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.principalSubject); + return writer; + }; + + /** + * Encodes the specified ServiceAccountDelegationInfo message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v1.IServiceAccountDelegationInfo} message ServiceAccountDelegationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountDelegationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccountDelegationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountDelegationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.principalEmail = reader.string(); + break; + } + case 2: { + message.principalSubject = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccountDelegationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountDelegationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccountDelegationInfo message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccountDelegationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + if (!$util.isString(message.principalEmail)) + return "principalEmail: string expected"; + if (message.principalSubject != null && message.hasOwnProperty("principalSubject")) + if (!$util.isString(message.principalSubject)) + return "principalSubject: string expected"; + return null; + }; + + /** + * Creates a ServiceAccountDelegationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} ServiceAccountDelegationInfo + */ + ServiceAccountDelegationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo) + return object; + var message = new $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo(); + if (object.principalEmail != null) + message.principalEmail = String(object.principalEmail); + if (object.principalSubject != null) + message.principalSubject = String(object.principalSubject); + return message; + }; + + /** + * Creates a plain object from a ServiceAccountDelegationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {google.cloud.securitycenter.v1.ServiceAccountDelegationInfo} message ServiceAccountDelegationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccountDelegationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.principalEmail = ""; + object.principalSubject = ""; + } + if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) + object.principalEmail = message.principalEmail; + if (message.principalSubject != null && message.hasOwnProperty("principalSubject")) + object.principalSubject = message.principalSubject; + return object; + }; + + /** + * Converts this ServiceAccountDelegationInfo to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @instance + * @returns {Object.} JSON object + */ + ServiceAccountDelegationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccountDelegationInfo + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ServiceAccountDelegationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccountDelegationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ServiceAccountDelegationInfo"; + }; + + return ServiceAccountDelegationInfo; + })(); + + v1.Geolocation = (function() { + + /** + * Properties of a Geolocation. + * @memberof google.cloud.securitycenter.v1 + * @interface IGeolocation + * @property {string|null} [regionCode] Geolocation regionCode + */ + + /** + * Constructs a new Geolocation. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Geolocation. + * @implements IGeolocation + * @constructor + * @param {google.cloud.securitycenter.v1.IGeolocation=} [properties] Properties to set + */ + function Geolocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Geolocation regionCode. + * @member {string} regionCode + * @memberof google.cloud.securitycenter.v1.Geolocation + * @instance + */ + Geolocation.prototype.regionCode = ""; + + /** + * Creates a new Geolocation instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {google.cloud.securitycenter.v1.IGeolocation=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Geolocation} Geolocation instance + */ + Geolocation.create = function create(properties) { + return new Geolocation(properties); + }; + + /** + * Encodes the specified Geolocation message. Does not implicitly {@link google.cloud.securitycenter.v1.Geolocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {google.cloud.securitycenter.v1.IGeolocation} message Geolocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Geolocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.regionCode); + return writer; + }; + + /** + * Encodes the specified Geolocation message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Geolocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {google.cloud.securitycenter.v1.IGeolocation} message Geolocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Geolocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Geolocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Geolocation} Geolocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Geolocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Geolocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.regionCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Geolocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Geolocation} Geolocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Geolocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Geolocation message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Geolocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + return null; + }; + + /** + * Creates a Geolocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Geolocation} Geolocation + */ + Geolocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Geolocation) + return object; + var message = new $root.google.cloud.securitycenter.v1.Geolocation(); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + return message; + }; + + /** + * Creates a plain object from a Geolocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {google.cloud.securitycenter.v1.Geolocation} message Geolocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Geolocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.regionCode = ""; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + return object; + }; + + /** + * Converts this Geolocation to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Geolocation + * @instance + * @returns {Object.} JSON object + */ + Geolocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Geolocation + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Geolocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Geolocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Geolocation"; + }; + + return Geolocation; + })(); + + v1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.securitycenter.v1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties + * @property {Object.|null} [resourceProperties] Asset resourceProperties + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Asset securityMarks + * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * @property {google.cloud.securitycenter.v1.Asset.IIamPolicy|null} [iamPolicy] Asset iamPolicy + * @property {string|null} [canonicalName] Asset canonicalName + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.securitycenter.v1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.resourceProperties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset securityCenterProperties. + * @member {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.securityCenterProperties = null; + + /** + * Asset resourceProperties. + * @member {Object.} resourceProperties + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.resourceProperties = $util.emptyObject; + + /** + * Asset securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.securityMarks = null; + + /** + * Asset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.createTime = null; + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Asset iamPolicy. + * @member {google.cloud.securitycenter.v1.Asset.IIamPolicy|null|undefined} iamPolicy + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + */ + Asset.prototype.canonicalName = ""; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {google.cloud.securitycenter.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {google.cloud.securitycenter.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.securityCenterProperties != null && Object.hasOwnProperty.call(message, "securityCenterProperties")) + $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceProperties != null && Object.hasOwnProperty.call(message, "resourceProperties")) + for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) + $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) + $root.google.cloud.securitycenter.v1.Asset.IamPolicy.encode(message.iamPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.canonicalName); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {google.cloud.securitycenter.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Asset(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.resourceProperties[key] = value; + break; + } + case 8: { + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.decode(reader, reader.uint32()); + break; + } + case 13: { + message.canonicalName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { + var error = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); + if (error) + return "securityCenterProperties." + error; + } + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { + if (!$util.isObject(message.resourceProperties)) + return "resourceProperties: object expected"; + var key = Object.keys(message.resourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); + if (error) + return "resourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Asset) + return object; + var message = new $root.google.cloud.securitycenter.v1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.securityCenterProperties != null) { + if (typeof object.securityCenterProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.securityCenterProperties: object expected"); + message.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); + } + if (object.resourceProperties) { + if (typeof object.resourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.resourceProperties: object expected"); + message.resourceProperties = {}; + for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.resourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.resourceProperties: object expected"); + message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.fromObject(object.iamPolicy); + } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {google.cloud.securitycenter.v1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.resourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.securityCenterProperties = null; + object.securityMarks = null; + object.createTime = null; + object.updateTime = null; + object.iamPolicy = null; + object.canonicalName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + object.securityCenterProperties = $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); + var keys2; + if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { + object.resourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.cloud.securitycenter.v1.Asset.IamPolicy.toObject(message.iamPolicy, options); + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Asset"; + }; + + Asset.SecurityCenterProperties = (function() { + + /** + * Properties of a SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1.Asset + * @interface ISecurityCenterProperties + * @property {string|null} [resourceName] SecurityCenterProperties resourceName + * @property {string|null} [resourceType] SecurityCenterProperties resourceType + * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent + * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject + * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners + * @property {string|null} [resourceDisplayName] SecurityCenterProperties resourceDisplayName + * @property {string|null} [resourceParentDisplayName] SecurityCenterProperties resourceParentDisplayName + * @property {string|null} [resourceProjectDisplayName] SecurityCenterProperties resourceProjectDisplayName + * @property {Array.|null} [folders] SecurityCenterProperties folders + */ + + /** + * Constructs a new SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1.Asset + * @classdesc Represents a SecurityCenterProperties. + * @implements ISecurityCenterProperties + * @constructor + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties=} [properties] Properties to set + */ + function SecurityCenterProperties(properties) { + this.resourceOwners = []; + this.folders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityCenterProperties resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceName = ""; + + /** + * SecurityCenterProperties resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceType = ""; + + /** + * SecurityCenterProperties resourceParent. + * @member {string} resourceParent + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParent = ""; + + /** + * SecurityCenterProperties resourceProject. + * @member {string} resourceProject + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProject = ""; + + /** + * SecurityCenterProperties resourceOwners. + * @member {Array.} resourceOwners + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; + + /** + * SecurityCenterProperties resourceDisplayName. + * @member {string} resourceDisplayName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceDisplayName = ""; + + /** + * SecurityCenterProperties resourceParentDisplayName. + * @member {string} resourceParentDisplayName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParentDisplayName = ""; + + /** + * SecurityCenterProperties resourceProjectDisplayName. + * @member {string} resourceProjectDisplayName + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProjectDisplayName = ""; + + /** + * SecurityCenterProperties folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.folders = $util.emptyArray; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties instance + */ + SecurityCenterProperties.create = function create(properties) { + return new SecurityCenterProperties(properties); + }; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resourceParent != null && Object.hasOwnProperty.call(message, "resourceParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); + if (message.resourceProject != null && Object.hasOwnProperty.call(message, "resourceProject")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); + if (message.resourceOwners != null && message.resourceOwners.length) + for (var i = 0; i < message.resourceOwners.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); + if (message.resourceDisplayName != null && Object.hasOwnProperty.call(message, "resourceDisplayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceDisplayName); + if (message.resourceParentDisplayName != null && Object.hasOwnProperty.call(message, "resourceParentDisplayName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.resourceParentDisplayName); + if (message.resourceProjectDisplayName != null && Object.hasOwnProperty.call(message, "resourceProjectDisplayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceProjectDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resourceName = reader.string(); + break; + } + case 2: { + message.resourceType = reader.string(); + break; + } + case 3: { + message.resourceParent = reader.string(); + break; + } + case 4: { + message.resourceProject = reader.string(); + break; + } + case 5: { + if (!(message.resourceOwners && message.resourceOwners.length)) + message.resourceOwners = []; + message.resourceOwners.push(reader.string()); + break; + } + case 6: { + message.resourceDisplayName = reader.string(); + break; + } + case 7: { + message.resourceParentDisplayName = reader.string(); + break; + } + case 8: { + message.resourceProjectDisplayName = reader.string(); + break; + } + case 10: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityCenterProperties message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityCenterProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + if (!$util.isString(message.resourceParent)) + return "resourceParent: string expected"; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + if (!$util.isString(message.resourceProject)) + return "resourceProject: string expected"; + if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { + if (!Array.isArray(message.resourceOwners)) + return "resourceOwners: array expected"; + for (var i = 0; i < message.resourceOwners.length; ++i) + if (!$util.isString(message.resourceOwners[i])) + return "resourceOwners: string[] expected"; + } + if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + if (!$util.isString(message.resourceDisplayName)) + return "resourceDisplayName: string expected"; + if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + if (!$util.isString(message.resourceParentDisplayName)) + return "resourceParentDisplayName: string expected"; + if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + if (!$util.isString(message.resourceProjectDisplayName)) + return "resourceProjectDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } + return null; + }; + + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} SecurityCenterProperties + */ + SecurityCenterProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) + return object; + var message = new $root.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resourceParent != null) + message.resourceParent = String(object.resourceParent); + if (object.resourceProject != null) + message.resourceProject = String(object.resourceProject); + if (object.resourceOwners) { + if (!Array.isArray(object.resourceOwners)) + throw TypeError(".google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.resourceOwners: array expected"); + message.resourceOwners = []; + for (var i = 0; i < object.resourceOwners.length; ++i) + message.resourceOwners[i] = String(object.resourceOwners[i]); + } + if (object.resourceDisplayName != null) + message.resourceDisplayName = String(object.resourceDisplayName); + if (object.resourceParentDisplayName != null) + message.resourceParentDisplayName = String(object.resourceParentDisplayName); + if (object.resourceProjectDisplayName != null) + message.resourceProjectDisplayName = String(object.resourceProjectDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} message SecurityCenterProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityCenterProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resourceOwners = []; + object.folders = []; + } + if (options.defaults) { + object.resourceName = ""; + object.resourceType = ""; + object.resourceParent = ""; + object.resourceProject = ""; + object.resourceDisplayName = ""; + object.resourceParentDisplayName = ""; + object.resourceProjectDisplayName = ""; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + object.resourceParent = message.resourceParent; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + object.resourceProject = message.resourceProject; + if (message.resourceOwners && message.resourceOwners.length) { + object.resourceOwners = []; + for (var j = 0; j < message.resourceOwners.length; ++j) + object.resourceOwners[j] = message.resourceOwners[j]; + } + if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + object.resourceDisplayName = message.resourceDisplayName; + if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + object.resourceParentDisplayName = message.resourceParentDisplayName; + if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + object.resourceProjectDisplayName = message.resourceProjectDisplayName; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); + } + return object; + }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @instance + * @returns {Object.} JSON object + */ + SecurityCenterProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityCenterProperties + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityCenterProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Asset.SecurityCenterProperties"; + }; + + return SecurityCenterProperties; + })(); + + Asset.IamPolicy = (function() { + + /** + * Properties of an IamPolicy. + * @memberof google.cloud.securitycenter.v1.Asset + * @interface IIamPolicy + * @property {string|null} [policyBlob] IamPolicy policyBlob + */ + + /** + * Constructs a new IamPolicy. + * @memberof google.cloud.securitycenter.v1.Asset + * @classdesc Represents an IamPolicy. + * @implements IIamPolicy + * @constructor + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy=} [properties] Properties to set + */ + function IamPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IamPolicy policyBlob. + * @member {string} policyBlob + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @instance + */ + IamPolicy.prototype.policyBlob = ""; + + /** + * Creates a new IamPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy instance + */ + IamPolicy.create = function create(properties) { + return new IamPolicy(properties); + }; + + /** + * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyBlob != null && Object.hasOwnProperty.call(message, "policyBlob")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.policyBlob); + return writer; + }; + + /** + * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Asset.IamPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Asset.IamPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.policyBlob = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicy message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + if (!$util.isString(message.policyBlob)) + return "policyBlob: string expected"; + return null; + }; + + /** + * Creates an IamPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Asset.IamPolicy} IamPolicy + */ + IamPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Asset.IamPolicy) + return object; + var message = new $root.google.cloud.securitycenter.v1.Asset.IamPolicy(); + if (object.policyBlob != null) + message.policyBlob = String(object.policyBlob); + return message; + }; + + /** + * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1.Asset.IamPolicy} message IamPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.policyBlob = ""; + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + object.policyBlob = message.policyBlob; + return object; + }; + + /** + * Converts this IamPolicy to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @instance + * @returns {Object.} JSON object + */ + IamPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IamPolicy + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Asset.IamPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Asset.IamPolicy"; + }; + + return IamPolicy; + })(); + + return Asset; + })(); + + v1.Folder = (function() { + + /** + * Properties of a Folder. + * @memberof google.cloud.securitycenter.v1 + * @interface IFolder + * @property {string|null} [resourceFolder] Folder resourceFolder + * @property {string|null} [resourceFolderDisplayName] Folder resourceFolderDisplayName + */ + + /** + * Constructs a new Folder. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Folder. + * @implements IFolder + * @constructor + * @param {google.cloud.securitycenter.v1.IFolder=} [properties] Properties to set + */ + function Folder(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Folder resourceFolder. + * @member {string} resourceFolder + * @memberof google.cloud.securitycenter.v1.Folder + * @instance + */ + Folder.prototype.resourceFolder = ""; + + /** + * Folder resourceFolderDisplayName. + * @member {string} resourceFolderDisplayName + * @memberof google.cloud.securitycenter.v1.Folder + * @instance + */ + Folder.prototype.resourceFolderDisplayName = ""; + + /** + * Creates a new Folder instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {google.cloud.securitycenter.v1.IFolder=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Folder} Folder instance + */ + Folder.create = function create(properties) { + return new Folder(properties); + }; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v1.Folder.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {google.cloud.securitycenter.v1.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceFolder != null && Object.hasOwnProperty.call(message, "resourceFolder")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceFolder); + if (message.resourceFolderDisplayName != null && Object.hasOwnProperty.call(message, "resourceFolderDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceFolderDisplayName); + return writer; + }; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Folder.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {google.cloud.securitycenter.v1.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Folder(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resourceFolder = reader.string(); + break; + } + case 2: { + message.resourceFolderDisplayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Folder message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Folder.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceFolder != null && message.hasOwnProperty("resourceFolder")) + if (!$util.isString(message.resourceFolder)) + return "resourceFolder: string expected"; + if (message.resourceFolderDisplayName != null && message.hasOwnProperty("resourceFolderDisplayName")) + if (!$util.isString(message.resourceFolderDisplayName)) + return "resourceFolderDisplayName: string expected"; + return null; + }; + + /** + * Creates a Folder message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Folder} Folder + */ + Folder.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Folder) + return object; + var message = new $root.google.cloud.securitycenter.v1.Folder(); + if (object.resourceFolder != null) + message.resourceFolder = String(object.resourceFolder); + if (object.resourceFolderDisplayName != null) + message.resourceFolderDisplayName = String(object.resourceFolderDisplayName); + return message; + }; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {google.cloud.securitycenter.v1.Folder} message Folder + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Folder.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceFolder = ""; + object.resourceFolderDisplayName = ""; + } + if (message.resourceFolder != null && message.hasOwnProperty("resourceFolder")) + object.resourceFolder = message.resourceFolder; + if (message.resourceFolderDisplayName != null && message.hasOwnProperty("resourceFolderDisplayName")) + object.resourceFolderDisplayName = message.resourceFolderDisplayName; + return object; + }; + + /** + * Converts this Folder to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Folder + * @instance + * @returns {Object.} JSON object + */ + Folder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Folder + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Folder + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Folder.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Folder"; + }; + + return Folder; + })(); + + v1.SecurityMarks = (function() { + + /** + * Properties of a SecurityMarks. + * @memberof google.cloud.securitycenter.v1 + * @interface ISecurityMarks + * @property {string|null} [name] SecurityMarks name + * @property {Object.|null} [marks] SecurityMarks marks + * @property {string|null} [canonicalName] SecurityMarks canonicalName + */ + + /** + * Constructs a new SecurityMarks. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityMarks. + * @implements ISecurityMarks + * @constructor + * @param {google.cloud.securitycenter.v1.ISecurityMarks=} [properties] Properties to set + */ + function SecurityMarks(properties) { + this.marks = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityMarks name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.name = ""; + + /** + * SecurityMarks marks. + * @member {Object.} marks + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.marks = $util.emptyObject; + + /** + * SecurityMarks canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.canonicalName = ""; + + /** + * Creates a new SecurityMarks instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1.ISecurityMarks=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks instance + */ + SecurityMarks.create = function create(properties) { + return new SecurityMarks(properties); + }; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityMarks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.marks != null && Object.hasOwnProperty.call(message, "marks")) + for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.canonicalName); + return writer; + }; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SecurityMarks.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityMarks.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SecurityMarks(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.marks === $util.emptyObject) + message.marks = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.marks[key] = value; + break; + } + case 3: { + message.canonicalName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityMarks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityMarks message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityMarks.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.marks != null && message.hasOwnProperty("marks")) { + if (!$util.isObject(message.marks)) + return "marks: object expected"; + var key = Object.keys(message.marks); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.marks[key[i]])) + return "marks: string{k:string} expected"; + } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; + return null; + }; + + /** + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SecurityMarks} SecurityMarks + */ + SecurityMarks.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SecurityMarks) + return object; + var message = new $root.google.cloud.securitycenter.v1.SecurityMarks(); + if (object.name != null) + message.name = String(object.name); + if (object.marks) { + if (typeof object.marks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SecurityMarks.marks: object expected"); + message.marks = {}; + for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) + message.marks[keys[i]] = String(object.marks[keys[i]]); + } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + return message; + }; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1.SecurityMarks} message SecurityMarks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityMarks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.marks = {}; + if (options.defaults) { + object.name = ""; + object.canonicalName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.marks && (keys2 = Object.keys(message.marks)).length) { + object.marks = {}; + for (var j = 0; j < keys2.length; ++j) + object.marks[keys2[j]] = message.marks[keys2[j]]; + } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + return object; + }; + + /** + * Converts this SecurityMarks to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @instance + * @returns {Object.} JSON object + */ + SecurityMarks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityMarks + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SecurityMarks + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityMarks.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SecurityMarks"; + }; + + return SecurityMarks; + })(); + + v1.BigQueryExport = (function() { + + /** + * Properties of a BigQueryExport. + * @memberof google.cloud.securitycenter.v1 + * @interface IBigQueryExport + * @property {string|null} [name] BigQueryExport name + * @property {string|null} [description] BigQueryExport description + * @property {string|null} [filter] BigQueryExport filter + * @property {string|null} [dataset] BigQueryExport dataset + * @property {google.protobuf.ITimestamp|null} [createTime] BigQueryExport createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BigQueryExport updateTime + * @property {string|null} [mostRecentEditor] BigQueryExport mostRecentEditor + * @property {string|null} [principal] BigQueryExport principal + */ + + /** + * Constructs a new BigQueryExport. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a BigQueryExport. + * @implements IBigQueryExport + * @constructor + * @param {google.cloud.securitycenter.v1.IBigQueryExport=} [properties] Properties to set + */ + function BigQueryExport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryExport name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.name = ""; + + /** + * BigQueryExport description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.description = ""; + + /** + * BigQueryExport filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.filter = ""; + + /** + * BigQueryExport dataset. + * @member {string} dataset + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.dataset = ""; + + /** + * BigQueryExport createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.createTime = null; + + /** + * BigQueryExport updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.updateTime = null; + + /** + * BigQueryExport mostRecentEditor. + * @member {string} mostRecentEditor + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.mostRecentEditor = ""; + + /** + * BigQueryExport principal. + * @member {string} principal + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + */ + BigQueryExport.prototype.principal = ""; + + /** + * Creates a new BigQueryExport instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {google.cloud.securitycenter.v1.IBigQueryExport=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.BigQueryExport} BigQueryExport instance + */ + BigQueryExport.create = function create(properties) { + return new BigQueryExport(properties); + }; + + /** + * Encodes the specified BigQueryExport message. Does not implicitly {@link google.cloud.securitycenter.v1.BigQueryExport.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {google.cloud.securitycenter.v1.IBigQueryExport} message BigQueryExport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryExport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.dataset); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.mostRecentEditor != null && Object.hasOwnProperty.call(message, "mostRecentEditor")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.mostRecentEditor); + if (message.principal != null && Object.hasOwnProperty.call(message, "principal")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.principal); + return writer; + }; + + /** + * Encodes the specified BigQueryExport message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BigQueryExport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {google.cloud.securitycenter.v1.IBigQueryExport} message BigQueryExport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryExport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryExport message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.BigQueryExport} BigQueryExport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryExport.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.BigQueryExport(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.dataset = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.mostRecentEditor = reader.string(); + break; + } + case 8: { + message.principal = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryExport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.BigQueryExport} BigQueryExport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryExport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryExport message. + * @function verify + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryExport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.mostRecentEditor != null && message.hasOwnProperty("mostRecentEditor")) + if (!$util.isString(message.mostRecentEditor)) + return "mostRecentEditor: string expected"; + if (message.principal != null && message.hasOwnProperty("principal")) + if (!$util.isString(message.principal)) + return "principal: string expected"; + return null; + }; + + /** + * Creates a BigQueryExport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.BigQueryExport} BigQueryExport + */ + BigQueryExport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.BigQueryExport) + return object; + var message = new $root.google.cloud.securitycenter.v1.BigQueryExport(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.filter != null) + message.filter = String(object.filter); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.BigQueryExport.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.BigQueryExport.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.mostRecentEditor != null) + message.mostRecentEditor = String(object.mostRecentEditor); + if (object.principal != null) + message.principal = String(object.principal); + return message; + }; + + /** + * Creates a plain object from a BigQueryExport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {google.cloud.securitycenter.v1.BigQueryExport} message BigQueryExport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryExport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.filter = ""; + object.dataset = ""; + object.createTime = null; + object.updateTime = null; + object.mostRecentEditor = ""; + object.principal = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.mostRecentEditor != null && message.hasOwnProperty("mostRecentEditor")) + object.mostRecentEditor = message.mostRecentEditor; + if (message.principal != null && message.hasOwnProperty("principal")) + object.principal = message.principal; + return object; + }; + + /** + * Converts this BigQueryExport to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @instance + * @returns {Object.} JSON object + */ + BigQueryExport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryExport + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.BigQueryExport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryExport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.BigQueryExport"; + }; + + return BigQueryExport; + })(); + + v1.Compliance = (function() { + + /** + * Properties of a Compliance. + * @memberof google.cloud.securitycenter.v1 + * @interface ICompliance + * @property {string|null} [standard] Compliance standard + * @property {string|null} [version] Compliance version + * @property {Array.|null} [ids] Compliance ids + */ + + /** + * Constructs a new Compliance. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Compliance. + * @implements ICompliance + * @constructor + * @param {google.cloud.securitycenter.v1.ICompliance=} [properties] Properties to set + */ + function Compliance(properties) { + this.ids = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Compliance standard. + * @member {string} standard + * @memberof google.cloud.securitycenter.v1.Compliance + * @instance + */ + Compliance.prototype.standard = ""; + + /** + * Compliance version. + * @member {string} version + * @memberof google.cloud.securitycenter.v1.Compliance + * @instance + */ + Compliance.prototype.version = ""; + + /** + * Compliance ids. + * @member {Array.} ids + * @memberof google.cloud.securitycenter.v1.Compliance + * @instance + */ + Compliance.prototype.ids = $util.emptyArray; + + /** + * Creates a new Compliance instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {google.cloud.securitycenter.v1.ICompliance=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Compliance} Compliance instance + */ + Compliance.create = function create(properties) { + return new Compliance(properties); + }; + + /** + * Encodes the specified Compliance message. Does not implicitly {@link google.cloud.securitycenter.v1.Compliance.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {google.cloud.securitycenter.v1.ICompliance} message Compliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Compliance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.standard != null && Object.hasOwnProperty.call(message, "standard")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.standard); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ids[i]); + return writer; + }; + + /** + * Encodes the specified Compliance message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Compliance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {google.cloud.securitycenter.v1.ICompliance} message Compliance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Compliance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Compliance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Compliance} Compliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Compliance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Compliance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.standard = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + case 3: { + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Compliance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Compliance} Compliance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Compliance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Compliance message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Compliance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.standard != null && message.hasOwnProperty("standard")) + if (!$util.isString(message.standard)) + return "standard: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!$util.isString(message.ids[i])) + return "ids: string[] expected"; + } + return null; + }; + + /** + * Creates a Compliance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Compliance} Compliance + */ + Compliance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Compliance) + return object; + var message = new $root.google.cloud.securitycenter.v1.Compliance(); + if (object.standard != null) + message.standard = String(object.standard); + if (object.version != null) + message.version = String(object.version); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".google.cloud.securitycenter.v1.Compliance.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + message.ids[i] = String(object.ids[i]); + } + return message; + }; + + /** + * Creates a plain object from a Compliance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {google.cloud.securitycenter.v1.Compliance} message Compliance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Compliance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) { + object.standard = ""; + object.version = ""; + } + if (message.standard != null && message.hasOwnProperty("standard")) + object.standard = message.standard; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = message.ids[j]; + } + return object; + }; + + /** + * Converts this Compliance to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Compliance + * @instance + * @returns {Object.} JSON object + */ + Compliance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Compliance + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Compliance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Compliance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Compliance"; + }; + + return Compliance; + })(); + + v1.Connection = (function() { + + /** + * Properties of a Connection. + * @memberof google.cloud.securitycenter.v1 + * @interface IConnection + * @property {string|null} [destinationIp] Connection destinationIp + * @property {number|null} [destinationPort] Connection destinationPort + * @property {string|null} [sourceIp] Connection sourceIp + * @property {number|null} [sourcePort] Connection sourcePort + * @property {google.cloud.securitycenter.v1.Connection.Protocol|null} [protocol] Connection protocol + */ + + /** + * Constructs a new Connection. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Connection. + * @implements IConnection + * @constructor + * @param {google.cloud.securitycenter.v1.IConnection=} [properties] Properties to set + */ + function Connection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Connection destinationIp. + * @member {string} destinationIp + * @memberof google.cloud.securitycenter.v1.Connection + * @instance + */ + Connection.prototype.destinationIp = ""; + + /** + * Connection destinationPort. + * @member {number} destinationPort + * @memberof google.cloud.securitycenter.v1.Connection + * @instance + */ + Connection.prototype.destinationPort = 0; + + /** + * Connection sourceIp. + * @member {string} sourceIp + * @memberof google.cloud.securitycenter.v1.Connection + * @instance + */ + Connection.prototype.sourceIp = ""; + + /** + * Connection sourcePort. + * @member {number} sourcePort + * @memberof google.cloud.securitycenter.v1.Connection + * @instance + */ + Connection.prototype.sourcePort = 0; + + /** + * Connection protocol. + * @member {google.cloud.securitycenter.v1.Connection.Protocol} protocol + * @memberof google.cloud.securitycenter.v1.Connection + * @instance + */ + Connection.prototype.protocol = 0; + + /** + * Creates a new Connection instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {google.cloud.securitycenter.v1.IConnection=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Connection} Connection instance + */ + Connection.create = function create(properties) { + return new Connection(properties); + }; + + /** + * Encodes the specified Connection message. Does not implicitly {@link google.cloud.securitycenter.v1.Connection.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {google.cloud.securitycenter.v1.IConnection} message Connection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Connection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destinationIp != null && Object.hasOwnProperty.call(message, "destinationIp")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationIp); + if (message.destinationPort != null && Object.hasOwnProperty.call(message, "destinationPort")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.destinationPort); + if (message.sourceIp != null && Object.hasOwnProperty.call(message, "sourceIp")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceIp); + if (message.sourcePort != null && Object.hasOwnProperty.call(message, "sourcePort")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.sourcePort); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.protocol); + return writer; + }; + + /** + * Encodes the specified Connection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Connection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {google.cloud.securitycenter.v1.IConnection} message Connection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Connection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Connection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Connection} Connection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Connection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Connection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.destinationIp = reader.string(); + break; + } + case 2: { + message.destinationPort = reader.int32(); + break; + } + case 3: { + message.sourceIp = reader.string(); + break; + } + case 4: { + message.sourcePort = reader.int32(); + break; + } + case 5: { + message.protocol = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Connection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Connection} Connection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Connection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Connection message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Connection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destinationIp != null && message.hasOwnProperty("destinationIp")) + if (!$util.isString(message.destinationIp)) + return "destinationIp: string expected"; + if (message.destinationPort != null && message.hasOwnProperty("destinationPort")) + if (!$util.isInteger(message.destinationPort)) + return "destinationPort: integer expected"; + if (message.sourceIp != null && message.hasOwnProperty("sourceIp")) + if (!$util.isString(message.sourceIp)) + return "sourceIp: string expected"; + if (message.sourcePort != null && message.hasOwnProperty("sourcePort")) + if (!$util.isInteger(message.sourcePort)) + return "sourcePort: integer expected"; + if (message.protocol != null && message.hasOwnProperty("protocol")) + switch (message.protocol) { + default: + return "protocol: enum value expected"; + case 0: + case 1: + case 6: + case 17: + case 47: + case 50: + break; + } + return null; + }; + + /** + * Creates a Connection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Connection} Connection + */ + Connection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Connection) + return object; + var message = new $root.google.cloud.securitycenter.v1.Connection(); + if (object.destinationIp != null) + message.destinationIp = String(object.destinationIp); + if (object.destinationPort != null) + message.destinationPort = object.destinationPort | 0; + if (object.sourceIp != null) + message.sourceIp = String(object.sourceIp); + if (object.sourcePort != null) + message.sourcePort = object.sourcePort | 0; + switch (object.protocol) { + default: + if (typeof object.protocol === "number") { + message.protocol = object.protocol; + break; + } + break; + case "PROTOCOL_UNSPECIFIED": + case 0: + message.protocol = 0; + break; + case "ICMP": + case 1: + message.protocol = 1; + break; + case "TCP": + case 6: + message.protocol = 6; + break; + case "UDP": + case 17: + message.protocol = 17; + break; + case "GRE": + case 47: + message.protocol = 47; + break; + case "ESP": + case 50: + message.protocol = 50; + break; + } + return message; + }; + + /** + * Creates a plain object from a Connection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {google.cloud.securitycenter.v1.Connection} message Connection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Connection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.destinationIp = ""; + object.destinationPort = 0; + object.sourceIp = ""; + object.sourcePort = 0; + object.protocol = options.enums === String ? "PROTOCOL_UNSPECIFIED" : 0; + } + if (message.destinationIp != null && message.hasOwnProperty("destinationIp")) + object.destinationIp = message.destinationIp; + if (message.destinationPort != null && message.hasOwnProperty("destinationPort")) + object.destinationPort = message.destinationPort; + if (message.sourceIp != null && message.hasOwnProperty("sourceIp")) + object.sourceIp = message.sourceIp; + if (message.sourcePort != null && message.hasOwnProperty("sourcePort")) + object.sourcePort = message.sourcePort; + if (message.protocol != null && message.hasOwnProperty("protocol")) + object.protocol = options.enums === String ? $root.google.cloud.securitycenter.v1.Connection.Protocol[message.protocol] === undefined ? message.protocol : $root.google.cloud.securitycenter.v1.Connection.Protocol[message.protocol] : message.protocol; + return object; + }; + + /** + * Converts this Connection to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Connection + * @instance + * @returns {Object.} JSON object + */ + Connection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Connection + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Connection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Connection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Connection"; + }; + + /** + * Protocol enum. + * @name google.cloud.securitycenter.v1.Connection.Protocol + * @enum {number} + * @property {number} PROTOCOL_UNSPECIFIED=0 PROTOCOL_UNSPECIFIED value + * @property {number} ICMP=1 ICMP value + * @property {number} TCP=6 TCP value + * @property {number} UDP=17 UDP value + * @property {number} GRE=47 GRE value + * @property {number} ESP=50 ESP value + */ + Connection.Protocol = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROTOCOL_UNSPECIFIED"] = 0; + values[valuesById[1] = "ICMP"] = 1; + values[valuesById[6] = "TCP"] = 6; + values[valuesById[17] = "UDP"] = 17; + values[valuesById[47] = "GRE"] = 47; + values[valuesById[50] = "ESP"] = 50; + return values; + })(); + + return Connection; + })(); + + v1.ContactDetails = (function() { + + /** + * Properties of a ContactDetails. + * @memberof google.cloud.securitycenter.v1 + * @interface IContactDetails + * @property {Array.|null} [contacts] ContactDetails contacts + */ + + /** + * Constructs a new ContactDetails. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ContactDetails. + * @implements IContactDetails + * @constructor + * @param {google.cloud.securitycenter.v1.IContactDetails=} [properties] Properties to set + */ + function ContactDetails(properties) { + this.contacts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContactDetails contacts. + * @member {Array.} contacts + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @instance + */ + ContactDetails.prototype.contacts = $util.emptyArray; + + /** + * Creates a new ContactDetails instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {google.cloud.securitycenter.v1.IContactDetails=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ContactDetails} ContactDetails instance + */ + ContactDetails.create = function create(properties) { + return new ContactDetails(properties); + }; + + /** + * Encodes the specified ContactDetails message. Does not implicitly {@link google.cloud.securitycenter.v1.ContactDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {google.cloud.securitycenter.v1.IContactDetails} message ContactDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContactDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contacts != null && message.contacts.length) + for (var i = 0; i < message.contacts.length; ++i) + $root.google.cloud.securitycenter.v1.Contact.encode(message.contacts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContactDetails message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ContactDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {google.cloud.securitycenter.v1.IContactDetails} message ContactDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContactDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContactDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ContactDetails} ContactDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContactDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ContactDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.contacts && message.contacts.length)) + message.contacts = []; + message.contacts.push($root.google.cloud.securitycenter.v1.Contact.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContactDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ContactDetails} ContactDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContactDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContactDetails message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContactDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contacts != null && message.hasOwnProperty("contacts")) { + if (!Array.isArray(message.contacts)) + return "contacts: array expected"; + for (var i = 0; i < message.contacts.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Contact.verify(message.contacts[i]); + if (error) + return "contacts." + error; + } + } + return null; + }; + + /** + * Creates a ContactDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ContactDetails} ContactDetails + */ + ContactDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ContactDetails) + return object; + var message = new $root.google.cloud.securitycenter.v1.ContactDetails(); + if (object.contacts) { + if (!Array.isArray(object.contacts)) + throw TypeError(".google.cloud.securitycenter.v1.ContactDetails.contacts: array expected"); + message.contacts = []; + for (var i = 0; i < object.contacts.length; ++i) { + if (typeof object.contacts[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ContactDetails.contacts: object expected"); + message.contacts[i] = $root.google.cloud.securitycenter.v1.Contact.fromObject(object.contacts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ContactDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {google.cloud.securitycenter.v1.ContactDetails} message ContactDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContactDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contacts = []; + if (message.contacts && message.contacts.length) { + object.contacts = []; + for (var j = 0; j < message.contacts.length; ++j) + object.contacts[j] = $root.google.cloud.securitycenter.v1.Contact.toObject(message.contacts[j], options); + } + return object; + }; + + /** + * Converts this ContactDetails to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @instance + * @returns {Object.} JSON object + */ + ContactDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContactDetails + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ContactDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContactDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ContactDetails"; + }; + + return ContactDetails; + })(); + + v1.Contact = (function() { + + /** + * Properties of a Contact. + * @memberof google.cloud.securitycenter.v1 + * @interface IContact + * @property {string|null} [email] Contact email + */ + + /** + * Constructs a new Contact. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Contact. + * @implements IContact + * @constructor + * @param {google.cloud.securitycenter.v1.IContact=} [properties] Properties to set + */ + function Contact(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Contact email. + * @member {string} email + * @memberof google.cloud.securitycenter.v1.Contact + * @instance + */ + Contact.prototype.email = ""; + + /** + * Creates a new Contact instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {google.cloud.securitycenter.v1.IContact=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Contact} Contact instance + */ + Contact.create = function create(properties) { + return new Contact(properties); + }; + + /** + * Encodes the specified Contact message. Does not implicitly {@link google.cloud.securitycenter.v1.Contact.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {google.cloud.securitycenter.v1.IContact} message Contact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Contact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + return writer; + }; + + /** + * Encodes the specified Contact message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Contact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {google.cloud.securitycenter.v1.IContact} message Contact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Contact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Contact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Contact} Contact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Contact.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Contact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.email = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Contact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Contact} Contact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Contact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Contact message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Contact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + return null; + }; + + /** + * Creates a Contact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Contact} Contact + */ + Contact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Contact) + return object; + var message = new $root.google.cloud.securitycenter.v1.Contact(); + if (object.email != null) + message.email = String(object.email); + return message; + }; + + /** + * Creates a plain object from a Contact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {google.cloud.securitycenter.v1.Contact} message Contact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Contact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.email = ""; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + return object; + }; + + /** + * Converts this Contact to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Contact + * @instance + * @returns {Object.} JSON object + */ + Contact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Contact + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Contact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Contact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Contact"; + }; + + return Contact; + })(); + + v1.Container = (function() { + + /** + * Properties of a Container. + * @memberof google.cloud.securitycenter.v1 + * @interface IContainer + * @property {string|null} [name] Container name + * @property {string|null} [uri] Container uri + * @property {string|null} [imageId] Container imageId + * @property {Array.|null} [labels] Container labels + */ + + /** + * Constructs a new Container. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Container. + * @implements IContainer + * @constructor + * @param {google.cloud.securitycenter.v1.IContainer=} [properties] Properties to set + */ + function Container(properties) { + this.labels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Container name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Container + * @instance + */ + Container.prototype.name = ""; + + /** + * Container uri. + * @member {string} uri + * @memberof google.cloud.securitycenter.v1.Container + * @instance + */ + Container.prototype.uri = ""; + + /** + * Container imageId. + * @member {string} imageId + * @memberof google.cloud.securitycenter.v1.Container + * @instance + */ + Container.prototype.imageId = ""; + + /** + * Container labels. + * @member {Array.} labels + * @memberof google.cloud.securitycenter.v1.Container + * @instance + */ + Container.prototype.labels = $util.emptyArray; + + /** + * Creates a new Container instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {google.cloud.securitycenter.v1.IContainer=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Container} Container instance + */ + Container.create = function create(properties) { + return new Container(properties); + }; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.securitycenter.v1.Container.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {google.cloud.securitycenter.v1.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.imageId != null && Object.hasOwnProperty.call(message, "imageId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageId); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + $root.google.cloud.securitycenter.v1.Label.encode(message.labels[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Container.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {google.cloud.securitycenter.v1.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Container message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Container(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + case 3: { + message.imageId = reader.string(); + break; + } + case 4: { + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push($root.google.cloud.securitycenter.v1.Label.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Container message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Container.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.imageId != null && message.hasOwnProperty("imageId")) + if (!$util.isString(message.imageId)) + return "imageId: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Label.verify(message.labels[i]); + if (error) + return "labels." + error; + } + } + return null; + }; + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Container} Container + */ + Container.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Container) + return object; + var message = new $root.google.cloud.securitycenter.v1.Container(); + if (object.name != null) + message.name = String(object.name); + if (object.uri != null) + message.uri = String(object.uri); + if (object.imageId != null) + message.imageId = String(object.imageId); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.cloud.securitycenter.v1.Container.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) { + if (typeof object.labels[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Container.labels: object expected"); + message.labels[i] = $root.google.cloud.securitycenter.v1.Label.fromObject(object.labels[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {google.cloud.securitycenter.v1.Container} message Container + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Container.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.labels = []; + if (options.defaults) { + object.name = ""; + object.uri = ""; + object.imageId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.imageId != null && message.hasOwnProperty("imageId")) + object.imageId = message.imageId; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = $root.google.cloud.securitycenter.v1.Label.toObject(message.labels[j], options); + } + return object; + }; + + /** + * Converts this Container to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Container + * @instance + * @returns {Object.} JSON object + */ + Container.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Container + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Container + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Container.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Container"; + }; + + return Container; + })(); + + v1.Label = (function() { + + /** + * Properties of a Label. + * @memberof google.cloud.securitycenter.v1 + * @interface ILabel + * @property {string|null} [name] Label name + * @property {string|null} [value] Label value + */ + + /** + * Constructs a new Label. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Label. + * @implements ILabel + * @constructor + * @param {google.cloud.securitycenter.v1.ILabel=} [properties] Properties to set + */ + function Label(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Label name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Label + * @instance + */ + Label.prototype.name = ""; + + /** + * Label value. + * @member {string} value + * @memberof google.cloud.securitycenter.v1.Label + * @instance + */ + Label.prototype.value = ""; + + /** + * Creates a new Label instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {google.cloud.securitycenter.v1.ILabel=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Label} Label instance + */ + Label.create = function create(properties) { + return new Label(properties); + }; + + /** + * Encodes the specified Label message. Does not implicitly {@link google.cloud.securitycenter.v1.Label.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {google.cloud.securitycenter.v1.ILabel} message Label message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Label.encode = function encode(message, writer) { + if (!writer) + 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 Label message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Label.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {google.cloud.securitycenter.v1.ILabel} message Label message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Label.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Label message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Label} Label + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Label.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Label(); + 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 Label message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Label} Label + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Label.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Label message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Label.verify = function verify(message) { + if (typeof message !== "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 Label message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Label} Label + */ + Label.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Label) + return object; + var message = new $root.google.cloud.securitycenter.v1.Label(); + 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 Label message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {google.cloud.securitycenter.v1.Label} message Label + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Label.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 Label to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Label + * @instance + * @returns {Object.} JSON object + */ + Label.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Label + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Label + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Label.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Label"; + }; + + return Label; + })(); + + v1.Database = (function() { + + /** + * Properties of a Database. + * @memberof google.cloud.securitycenter.v1 + * @interface IDatabase + * @property {string|null} [name] Database name + * @property {string|null} [displayName] Database displayName + * @property {string|null} [userName] Database userName + * @property {string|null} [query] Database query + * @property {Array.|null} [grantees] Database grantees + */ + + /** + * Constructs a new Database. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Database. + * @implements IDatabase + * @constructor + * @param {google.cloud.securitycenter.v1.IDatabase=} [properties] Properties to set + */ + function Database(properties) { + this.grantees = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Database name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.name = ""; + + /** + * Database displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.displayName = ""; + + /** + * Database userName. + * @member {string} userName + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.userName = ""; + + /** + * Database query. + * @member {string} query + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.query = ""; + + /** + * Database grantees. + * @member {Array.} grantees + * @memberof google.cloud.securitycenter.v1.Database + * @instance + */ + Database.prototype.grantees = $util.emptyArray; + + /** + * Creates a new Database instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {google.cloud.securitycenter.v1.IDatabase=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Database} Database instance + */ + Database.create = function create(properties) { + return new Database(properties); + }; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.securitycenter.v1.Database.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {google.cloud.securitycenter.v1.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encode = function encode(message, writer) { + if (!writer) + 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.userName != null && Object.hasOwnProperty.call(message, "userName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userName); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.query); + if (message.grantees != null && message.grantees.length) + for (var i = 0; i < message.grantees.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.grantees[i]); + return writer; + }; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Database.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {google.cloud.securitycenter.v1.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Database message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Database(); + 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.userName = reader.string(); + break; + } + case 4: { + message.query = reader.string(); + break; + } + case 5: { + if (!(message.grantees && message.grantees.length)) + message.grantees = []; + message.grantees.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Database message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Database.verify = function verify(message) { + if (typeof message !== "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.userName != null && message.hasOwnProperty("userName")) + if (!$util.isString(message.userName)) + return "userName: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.grantees != null && message.hasOwnProperty("grantees")) { + if (!Array.isArray(message.grantees)) + return "grantees: array expected"; + for (var i = 0; i < message.grantees.length; ++i) + if (!$util.isString(message.grantees[i])) + return "grantees: string[] expected"; + } + return null; + }; + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Database} Database + */ + Database.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Database) + return object; + var message = new $root.google.cloud.securitycenter.v1.Database(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.userName != null) + message.userName = String(object.userName); + if (object.query != null) + message.query = String(object.query); + if (object.grantees) { + if (!Array.isArray(object.grantees)) + throw TypeError(".google.cloud.securitycenter.v1.Database.grantees: array expected"); + message.grantees = []; + for (var i = 0; i < object.grantees.length; ++i) + message.grantees[i] = String(object.grantees[i]); + } + return message; + }; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {google.cloud.securitycenter.v1.Database} message Database + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Database.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.grantees = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.userName = ""; + object.query = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.userName != null && message.hasOwnProperty("userName")) + object.userName = message.userName; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.grantees && message.grantees.length) { + object.grantees = []; + for (var j = 0; j < message.grantees.length; ++j) + object.grantees[j] = message.grantees[j]; + } + return object; + }; + + /** + * Converts this Database to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Database + * @instance + * @returns {Object.} JSON object + */ + Database.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Database + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Database + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Database"; + }; + + return Database; + })(); + + v1.Exfiltration = (function() { + + /** + * Properties of an Exfiltration. + * @memberof google.cloud.securitycenter.v1 + * @interface IExfiltration + * @property {Array.|null} [sources] Exfiltration sources + * @property {Array.|null} [targets] Exfiltration targets + */ + + /** + * Constructs a new Exfiltration. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an Exfiltration. + * @implements IExfiltration + * @constructor + * @param {google.cloud.securitycenter.v1.IExfiltration=} [properties] Properties to set + */ + function Exfiltration(properties) { + this.sources = []; + this.targets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Exfiltration sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @instance + */ + Exfiltration.prototype.sources = $util.emptyArray; + + /** + * Exfiltration targets. + * @member {Array.} targets + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @instance + */ + Exfiltration.prototype.targets = $util.emptyArray; + + /** + * Creates a new Exfiltration instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {google.cloud.securitycenter.v1.IExfiltration=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration instance + */ + Exfiltration.create = function create(properties) { + return new Exfiltration(properties); + }; + + /** + * Encodes the specified Exfiltration message. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {google.cloud.securitycenter.v1.IExfiltration} message Exfiltration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exfiltration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.securitycenter.v1.ExfilResource.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + $root.google.cloud.securitycenter.v1.ExfilResource.encode(message.targets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Exfiltration message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Exfiltration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {google.cloud.securitycenter.v1.IExfiltration} message Exfiltration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exfiltration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Exfiltration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exfiltration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Exfiltration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1.ExfilResource.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.targets && message.targets.length)) + message.targets = []; + message.targets.push($root.google.cloud.securitycenter.v1.ExfilResource.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Exfiltration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exfiltration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Exfiltration message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Exfiltration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ExfilResource.verify(message.sources[i]); + if (error) + return "sources." + error; + } + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ExfilResource.verify(message.targets[i]); + if (error) + return "targets." + error; + } + } + return null; + }; + + /** + * Creates an Exfiltration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Exfiltration} Exfiltration + */ + Exfiltration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Exfiltration) + return object; + var message = new $root.google.cloud.securitycenter.v1.Exfiltration(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v1.ExfilResource.fromObject(object.sources[i]); + } + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) { + if (typeof object.targets[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Exfiltration.targets: object expected"); + message.targets[i] = $root.google.cloud.securitycenter.v1.ExfilResource.fromObject(object.targets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Exfiltration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {google.cloud.securitycenter.v1.Exfiltration} message Exfiltration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Exfiltration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sources = []; + object.targets = []; + } + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v1.ExfilResource.toObject(message.sources[j], options); + } + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = $root.google.cloud.securitycenter.v1.ExfilResource.toObject(message.targets[j], options); + } + return object; + }; + + /** + * Converts this Exfiltration to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @instance + * @returns {Object.} JSON object + */ + Exfiltration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Exfiltration + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Exfiltration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Exfiltration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Exfiltration"; + }; + + return Exfiltration; + })(); + + v1.ExfilResource = (function() { + + /** + * Properties of an ExfilResource. + * @memberof google.cloud.securitycenter.v1 + * @interface IExfilResource + * @property {string|null} [name] ExfilResource name + * @property {Array.|null} [components] ExfilResource components + */ + + /** + * Constructs a new ExfilResource. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an ExfilResource. + * @implements IExfilResource + * @constructor + * @param {google.cloud.securitycenter.v1.IExfilResource=} [properties] Properties to set + */ + function ExfilResource(properties) { + this.components = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExfilResource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @instance + */ + ExfilResource.prototype.name = ""; + + /** + * ExfilResource components. + * @member {Array.} components + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @instance + */ + ExfilResource.prototype.components = $util.emptyArray; + + /** + * Creates a new ExfilResource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {google.cloud.securitycenter.v1.IExfilResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource instance + */ + ExfilResource.create = function create(properties) { + return new ExfilResource(properties); + }; + + /** + * Encodes the specified ExfilResource message. Does not implicitly {@link google.cloud.securitycenter.v1.ExfilResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {google.cloud.securitycenter.v1.IExfilResource} message ExfilResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExfilResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.components != null && message.components.length) + for (var i = 0; i < message.components.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.components[i]); + return writer; + }; + + /** + * Encodes the specified ExfilResource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExfilResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {google.cloud.securitycenter.v1.IExfilResource} message ExfilResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExfilResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExfilResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExfilResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ExfilResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.components && message.components.length)) + message.components = []; + message.components.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExfilResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExfilResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExfilResource message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExfilResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.components != null && message.hasOwnProperty("components")) { + if (!Array.isArray(message.components)) + return "components: array expected"; + for (var i = 0; i < message.components.length; ++i) + if (!$util.isString(message.components[i])) + return "components: string[] expected"; + } + return null; + }; + + /** + * Creates an ExfilResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ExfilResource} ExfilResource + */ + ExfilResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ExfilResource) + return object; + var message = new $root.google.cloud.securitycenter.v1.ExfilResource(); + if (object.name != null) + message.name = String(object.name); + if (object.components) { + if (!Array.isArray(object.components)) + throw TypeError(".google.cloud.securitycenter.v1.ExfilResource.components: array expected"); + message.components = []; + for (var i = 0; i < object.components.length; ++i) + message.components[i] = String(object.components[i]); + } + return message; + }; + + /** + * Creates a plain object from an ExfilResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {google.cloud.securitycenter.v1.ExfilResource} message ExfilResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExfilResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.components = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.components && message.components.length) { + object.components = []; + for (var j = 0; j < message.components.length; ++j) + object.components[j] = message.components[j]; + } + return object; + }; + + /** + * Converts this ExfilResource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @instance + * @returns {Object.} JSON object + */ + ExfilResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExfilResource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ExfilResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExfilResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ExfilResource"; + }; + + return ExfilResource; + })(); + + v1.ExternalSystem = (function() { + + /** + * Properties of an ExternalSystem. + * @memberof google.cloud.securitycenter.v1 + * @interface IExternalSystem + * @property {string|null} [name] ExternalSystem name + * @property {Array.|null} [assignees] ExternalSystem assignees + * @property {string|null} [externalUid] ExternalSystem externalUid + * @property {string|null} [status] ExternalSystem status + * @property {google.protobuf.ITimestamp|null} [externalSystemUpdateTime] ExternalSystem externalSystemUpdateTime + */ + + /** + * Constructs a new ExternalSystem. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an ExternalSystem. + * @implements IExternalSystem + * @constructor + * @param {google.cloud.securitycenter.v1.IExternalSystem=} [properties] Properties to set + */ + function ExternalSystem(properties) { + this.assignees = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalSystem name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.name = ""; + + /** + * ExternalSystem assignees. + * @member {Array.} assignees + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.assignees = $util.emptyArray; + + /** + * ExternalSystem externalUid. + * @member {string} externalUid + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.externalUid = ""; + + /** + * ExternalSystem status. + * @member {string} status + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.status = ""; + + /** + * ExternalSystem externalSystemUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} externalSystemUpdateTime + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + */ + ExternalSystem.prototype.externalSystemUpdateTime = null; + + /** + * Creates a new ExternalSystem instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v1.IExternalSystem=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem instance + */ + ExternalSystem.create = function create(properties) { + return new ExternalSystem(properties); + }; + + /** + * Encodes the specified ExternalSystem message. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v1.IExternalSystem} message ExternalSystem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalSystem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assignees != null && message.assignees.length) + for (var i = 0; i < message.assignees.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assignees[i]); + if (message.externalUid != null && Object.hasOwnProperty.call(message, "externalUid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalUid); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.status); + if (message.externalSystemUpdateTime != null && Object.hasOwnProperty.call(message, "externalSystemUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.externalSystemUpdateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExternalSystem message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ExternalSystem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v1.IExternalSystem} message ExternalSystem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalSystem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExternalSystem message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalSystem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ExternalSystem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.assignees && message.assignees.length)) + message.assignees = []; + message.assignees.push(reader.string()); + break; + } + case 3: { + message.externalUid = reader.string(); + break; + } + case 4: { + message.status = reader.string(); + break; + } + case 5: { + message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalSystem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalSystem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalSystem message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalSystem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assignees != null && message.hasOwnProperty("assignees")) { + if (!Array.isArray(message.assignees)) + return "assignees: array expected"; + for (var i = 0; i < message.assignees.length; ++i) + if (!$util.isString(message.assignees[i])) + return "assignees: string[] expected"; + } + if (message.externalUid != null && message.hasOwnProperty("externalUid")) + if (!$util.isString(message.externalUid)) + return "externalUid: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (!$util.isString(message.status)) + return "status: string expected"; + if (message.externalSystemUpdateTime != null && message.hasOwnProperty("externalSystemUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.externalSystemUpdateTime); + if (error) + return "externalSystemUpdateTime." + error; + } + return null; + }; + + /** + * Creates an ExternalSystem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ExternalSystem} ExternalSystem + */ + ExternalSystem.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ExternalSystem) + return object; + var message = new $root.google.cloud.securitycenter.v1.ExternalSystem(); + if (object.name != null) + message.name = String(object.name); + if (object.assignees) { + if (!Array.isArray(object.assignees)) + throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.assignees: array expected"); + message.assignees = []; + for (var i = 0; i < object.assignees.length; ++i) + message.assignees[i] = String(object.assignees[i]); + } + if (object.externalUid != null) + message.externalUid = String(object.externalUid); + if (object.status != null) + message.status = String(object.status); + if (object.externalSystemUpdateTime != null) { + if (typeof object.externalSystemUpdateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ExternalSystem.externalSystemUpdateTime: object expected"); + message.externalSystemUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.externalSystemUpdateTime); + } + return message; + }; + + /** + * Creates a plain object from an ExternalSystem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {google.cloud.securitycenter.v1.ExternalSystem} message ExternalSystem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalSystem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assignees = []; + if (options.defaults) { + object.name = ""; + object.externalUid = ""; + object.status = ""; + object.externalSystemUpdateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assignees && message.assignees.length) { + object.assignees = []; + for (var j = 0; j < message.assignees.length; ++j) + object.assignees[j] = message.assignees[j]; + } + if (message.externalUid != null && message.hasOwnProperty("externalUid")) + object.externalUid = message.externalUid; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.externalSystemUpdateTime != null && message.hasOwnProperty("externalSystemUpdateTime")) + object.externalSystemUpdateTime = $root.google.protobuf.Timestamp.toObject(message.externalSystemUpdateTime, options); + return object; + }; + + /** + * Converts this ExternalSystem to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @instance + * @returns {Object.} JSON object + */ + ExternalSystem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExternalSystem + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ExternalSystem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExternalSystem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ExternalSystem"; + }; + + return ExternalSystem; + })(); + + v1.File = (function() { + + /** + * Properties of a File. + * @memberof google.cloud.securitycenter.v1 + * @interface IFile + * @property {string|null} [path] File path + * @property {number|Long|null} [size] File size + * @property {string|null} [sha256] File sha256 + * @property {number|Long|null} [hashedSize] File hashedSize + * @property {boolean|null} [partiallyHashed] File partiallyHashed + * @property {string|null} [contents] File contents + */ + + /** + * Constructs a new File. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a File. + * @implements IFile + * @constructor + * @param {google.cloud.securitycenter.v1.IFile=} [properties] Properties to set + */ + function File(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * File path. + * @member {string} path + * @memberof google.cloud.securitycenter.v1.File + * @instance + */ + File.prototype.path = ""; + + /** + * File size. + * @member {number|Long} size + * @memberof google.cloud.securitycenter.v1.File + * @instance + */ + File.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * File sha256. + * @member {string} sha256 + * @memberof google.cloud.securitycenter.v1.File + * @instance + */ + File.prototype.sha256 = ""; + + /** + * File hashedSize. + * @member {number|Long} hashedSize + * @memberof google.cloud.securitycenter.v1.File + * @instance + */ + File.prototype.hashedSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * File partiallyHashed. + * @member {boolean} partiallyHashed + * @memberof google.cloud.securitycenter.v1.File + * @instance + */ + File.prototype.partiallyHashed = false; + + /** + * File contents. + * @member {string} contents + * @memberof google.cloud.securitycenter.v1.File + * @instance + */ + File.prototype.contents = ""; + + /** + * Creates a new File instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {google.cloud.securitycenter.v1.IFile=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.File} File instance + */ + File.create = function create(properties) { + return new File(properties); + }; + + /** + * Encodes the specified File message. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {google.cloud.securitycenter.v1.IFile} message File message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + File.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.size); + if (message.sha256 != null && Object.hasOwnProperty.call(message, "sha256")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sha256); + if (message.hashedSize != null && Object.hasOwnProperty.call(message, "hashedSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.hashedSize); + if (message.partiallyHashed != null && Object.hasOwnProperty.call(message, "partiallyHashed")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.partiallyHashed); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.contents); + return writer; + }; + + /** + * Encodes the specified File message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.File.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {google.cloud.securitycenter.v1.IFile} message File message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + File.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a File message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.File} File + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + File.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.File(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.size = reader.int64(); + break; + } + case 3: { + message.sha256 = reader.string(); + break; + } + case 4: { + message.hashedSize = reader.int64(); + break; + } + case 5: { + message.partiallyHashed = reader.bool(); + break; + } + case 6: { + message.contents = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a File message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.File} File + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + File.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a File message. + * @function verify + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + File.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.size != null && message.hasOwnProperty("size")) + if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high))) + return "size: integer|Long expected"; + if (message.sha256 != null && message.hasOwnProperty("sha256")) + if (!$util.isString(message.sha256)) + return "sha256: string expected"; + if (message.hashedSize != null && message.hasOwnProperty("hashedSize")) + if (!$util.isInteger(message.hashedSize) && !(message.hashedSize && $util.isInteger(message.hashedSize.low) && $util.isInteger(message.hashedSize.high))) + return "hashedSize: integer|Long expected"; + if (message.partiallyHashed != null && message.hasOwnProperty("partiallyHashed")) + if (typeof message.partiallyHashed !== "boolean") + return "partiallyHashed: boolean expected"; + if (message.contents != null && message.hasOwnProperty("contents")) + if (!$util.isString(message.contents)) + return "contents: string expected"; + return null; + }; + + /** + * Creates a File message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.File} File + */ + File.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.File) + return object; + var message = new $root.google.cloud.securitycenter.v1.File(); + if (object.path != null) + message.path = String(object.path); + if (object.size != null) + if ($util.Long) + (message.size = $util.Long.fromValue(object.size)).unsigned = false; + else if (typeof object.size === "string") + message.size = parseInt(object.size, 10); + else if (typeof object.size === "number") + message.size = object.size; + else if (typeof object.size === "object") + message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber(); + if (object.sha256 != null) + message.sha256 = String(object.sha256); + if (object.hashedSize != null) + if ($util.Long) + (message.hashedSize = $util.Long.fromValue(object.hashedSize)).unsigned = false; + else if (typeof object.hashedSize === "string") + message.hashedSize = parseInt(object.hashedSize, 10); + else if (typeof object.hashedSize === "number") + message.hashedSize = object.hashedSize; + else if (typeof object.hashedSize === "object") + message.hashedSize = new $util.LongBits(object.hashedSize.low >>> 0, object.hashedSize.high >>> 0).toNumber(); + if (object.partiallyHashed != null) + message.partiallyHashed = Boolean(object.partiallyHashed); + if (object.contents != null) + message.contents = String(object.contents); + return message; + }; + + /** + * Creates a plain object from a File message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {google.cloud.securitycenter.v1.File} message File + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + File.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.path = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.size = options.longs === String ? "0" : 0; + object.sha256 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.hashedSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.hashedSize = options.longs === String ? "0" : 0; + object.partiallyHashed = false; + object.contents = ""; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.size != null && message.hasOwnProperty("size")) + if (typeof message.size === "number") + object.size = options.longs === String ? String(message.size) : message.size; + else + object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size; + if (message.sha256 != null && message.hasOwnProperty("sha256")) + object.sha256 = message.sha256; + if (message.hashedSize != null && message.hasOwnProperty("hashedSize")) + if (typeof message.hashedSize === "number") + object.hashedSize = options.longs === String ? String(message.hashedSize) : message.hashedSize; + else + object.hashedSize = options.longs === String ? $util.Long.prototype.toString.call(message.hashedSize) : options.longs === Number ? new $util.LongBits(message.hashedSize.low >>> 0, message.hashedSize.high >>> 0).toNumber() : message.hashedSize; + if (message.partiallyHashed != null && message.hasOwnProperty("partiallyHashed")) + object.partiallyHashed = message.partiallyHashed; + if (message.contents != null && message.hasOwnProperty("contents")) + object.contents = message.contents; + return object; + }; + + /** + * Converts this File to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.File + * @instance + * @returns {Object.} JSON object + */ + File.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for File + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.File + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + File.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.File"; + }; + + return File; + })(); + + v1.Finding = (function() { + + /** + * Properties of a Finding. + * @memberof google.cloud.securitycenter.v1 + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [parent] Finding parent + * @property {string|null} [resourceName] Finding resourceName + * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] Finding state + * @property {string|null} [category] Finding category + * @property {string|null} [externalUri] Finding externalUri + * @property {Object.|null} [sourceProperties] Finding sourceProperties + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] Finding securityMarks + * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime + * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + * @property {google.cloud.securitycenter.v1.Finding.Severity|null} [severity] Finding severity + * @property {string|null} [canonicalName] Finding canonicalName + * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [mute] Finding mute + * @property {google.cloud.securitycenter.v1.Finding.FindingClass|null} [findingClass] Finding findingClass + * @property {google.cloud.securitycenter.v1.IIndicator|null} [indicator] Finding indicator + * @property {google.cloud.securitycenter.v1.IVulnerability|null} [vulnerability] Finding vulnerability + * @property {google.protobuf.ITimestamp|null} [muteUpdateTime] Finding muteUpdateTime + * @property {Object.|null} [externalSystems] Finding externalSystems + * @property {google.cloud.securitycenter.v1.IMitreAttack|null} [mitreAttack] Finding mitreAttack + * @property {google.cloud.securitycenter.v1.IAccess|null} [access] Finding access + * @property {Array.|null} [connections] Finding connections + * @property {string|null} [muteInitiator] Finding muteInitiator + * @property {Array.|null} [processes] Finding processes + * @property {Object.|null} [contacts] Finding contacts + * @property {Array.|null} [compliances] Finding compliances + * @property {string|null} [parentDisplayName] Finding parentDisplayName + * @property {string|null} [description] Finding description + * @property {google.cloud.securitycenter.v1.IExfiltration|null} [exfiltration] Finding exfiltration + * @property {Array.|null} [iamBindings] Finding iamBindings + * @property {string|null} [nextSteps] Finding nextSteps + * @property {Array.|null} [containers] Finding containers + * @property {google.cloud.securitycenter.v1.IKubernetes|null} [kubernetes] Finding kubernetes + * @property {google.cloud.securitycenter.v1.IDatabase|null} [database] Finding database + * @property {Array.|null} [files] Finding files + */ + + /** + * Constructs a new Finding. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set + */ + function Finding(properties) { + this.sourceProperties = {}; + this.externalSystems = {}; + this.connections = []; + this.processes = []; + this.contacts = {}; + this.compliances = []; + this.iamBindings = []; + this.containers = []; + this.files = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Finding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.name = ""; + + /** + * Finding parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.parent = ""; + + /** + * Finding resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.resourceName = ""; + + /** + * Finding state. + * @member {google.cloud.securitycenter.v1.Finding.State} state + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.state = 0; + + /** + * Finding category. + * @member {string} category + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.category = ""; + + /** + * Finding externalUri. + * @member {string} externalUri + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.externalUri = ""; + + /** + * Finding sourceProperties. + * @member {Object.} sourceProperties + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.sourceProperties = $util.emptyObject; + + /** + * Finding securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.securityMarks = null; + + /** + * Finding eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.eventTime = null; + + /** + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.createTime = null; + + /** + * Finding severity. + * @member {google.cloud.securitycenter.v1.Finding.Severity} severity + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.severity = 0; + + /** + * Finding canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.canonicalName = ""; + + /** + * Finding mute. + * @member {google.cloud.securitycenter.v1.Finding.Mute} mute + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.mute = 0; + + /** + * Finding findingClass. + * @member {google.cloud.securitycenter.v1.Finding.FindingClass} findingClass + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.findingClass = 0; + + /** + * Finding indicator. + * @member {google.cloud.securitycenter.v1.IIndicator|null|undefined} indicator + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.indicator = null; + + /** + * Finding vulnerability. + * @member {google.cloud.securitycenter.v1.IVulnerability|null|undefined} vulnerability + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.vulnerability = null; + + /** + * Finding muteUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} muteUpdateTime + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.muteUpdateTime = null; + + /** + * Finding externalSystems. + * @member {Object.} externalSystems + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.externalSystems = $util.emptyObject; + + /** + * Finding mitreAttack. + * @member {google.cloud.securitycenter.v1.IMitreAttack|null|undefined} mitreAttack + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.mitreAttack = null; + + /** + * Finding access. + * @member {google.cloud.securitycenter.v1.IAccess|null|undefined} access + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.access = null; + + /** + * Finding connections. + * @member {Array.} connections + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.connections = $util.emptyArray; + + /** + * Finding muteInitiator. + * @member {string} muteInitiator + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.muteInitiator = ""; + + /** + * Finding processes. + * @member {Array.} processes + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.processes = $util.emptyArray; + + /** + * Finding contacts. + * @member {Object.} contacts + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.contacts = $util.emptyObject; + + /** + * Finding compliances. + * @member {Array.} compliances + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.compliances = $util.emptyArray; + + /** + * Finding parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.parentDisplayName = ""; + + /** + * Finding description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.description = ""; + + /** + * Finding exfiltration. + * @member {google.cloud.securitycenter.v1.IExfiltration|null|undefined} exfiltration + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.exfiltration = null; + + /** + * Finding iamBindings. + * @member {Array.} iamBindings + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.iamBindings = $util.emptyArray; + + /** + * Finding nextSteps. + * @member {string} nextSteps + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.nextSteps = ""; + + /** + * Finding containers. + * @member {Array.} containers + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.containers = $util.emptyArray; + + /** + * Finding kubernetes. + * @member {google.cloud.securitycenter.v1.IKubernetes|null|undefined} kubernetes + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.kubernetes = null; + + /** + * Finding database. + * @member {google.cloud.securitycenter.v1.IDatabase|null|undefined} database + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.database = null; + + /** + * Finding files. + * @member {Array.} files + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.files = $util.emptyArray; + + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.v1.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); + if (message.sourceProperties != null && Object.hasOwnProperty.call(message, "sourceProperties")) + for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) + $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.severity); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); + if (message.mute != null && Object.hasOwnProperty.call(message, "mute")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.mute); + if (message.findingClass != null && Object.hasOwnProperty.call(message, "findingClass")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.findingClass); + if (message.indicator != null && Object.hasOwnProperty.call(message, "indicator")) + $root.google.cloud.securitycenter.v1.Indicator.encode(message.indicator, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.vulnerability != null && Object.hasOwnProperty.call(message, "vulnerability")) + $root.google.cloud.securitycenter.v1.Vulnerability.encode(message.vulnerability, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.muteUpdateTime != null && Object.hasOwnProperty.call(message, "muteUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.muteUpdateTime, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.externalSystems != null && Object.hasOwnProperty.call(message, "externalSystems")) + for (var keys = Object.keys(message.externalSystems), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.securitycenter.v1.ExternalSystem.encode(message.externalSystems[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.mitreAttack != null && Object.hasOwnProperty.call(message, "mitreAttack")) + $root.google.cloud.securitycenter.v1.MitreAttack.encode(message.mitreAttack, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.access != null && Object.hasOwnProperty.call(message, "access")) + $root.google.cloud.securitycenter.v1.Access.encode(message.access, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.muteInitiator != null && Object.hasOwnProperty.call(message, "muteInitiator")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.muteInitiator); + if (message.processes != null && message.processes.length) + for (var i = 0; i < message.processes.length; ++i) + $root.google.cloud.securitycenter.v1.Process.encode(message.processes[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.connections != null && message.connections.length) + for (var i = 0; i < message.connections.length; ++i) + $root.google.cloud.securitycenter.v1.Connection.encode(message.connections[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.contacts != null && Object.hasOwnProperty.call(message, "contacts")) + for (var keys = Object.keys(message.contacts), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 33, wireType 2 =*/266).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.securitycenter.v1.ContactDetails.encode(message.contacts[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.compliances != null && message.compliances.length) + for (var i = 0; i < message.compliances.length; ++i) + $root.google.cloud.securitycenter.v1.Compliance.encode(message.compliances[i], writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.parentDisplayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.description); + if (message.exfiltration != null && Object.hasOwnProperty.call(message, "exfiltration")) + $root.google.cloud.securitycenter.v1.Exfiltration.encode(message.exfiltration, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + if (message.iamBindings != null && message.iamBindings.length) + for (var i = 0; i < message.iamBindings.length; ++i) + $root.google.cloud.securitycenter.v1.IamBinding.encode(message.iamBindings[i], writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.nextSteps != null && Object.hasOwnProperty.call(message, "nextSteps")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.nextSteps); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.securitycenter.v1.Container.encode(message.containers[i], writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.kubernetes != null && Object.hasOwnProperty.call(message, "kubernetes")) + $root.google.cloud.securitycenter.v1.Kubernetes.encode(message.kubernetes, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + $root.google.cloud.securitycenter.v1.Database.encode(message.database, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.files != null && message.files.length) + for (var i = 0; i < message.files.length; ++i) + $root.google.cloud.securitycenter.v1.File.encode(message.files[i], writer.uint32(/* id 46, wireType 2 =*/370).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.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.securitycenter.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.securitycenter.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.securitycenter.v1.Finding(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.resourceName = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.category = reader.string(); + break; + } + case 6: { + message.externalUri = reader.string(); + break; + } + case 7: { + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.sourceProperties[key] = value; + break; + } + case 8: { + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 9: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.severity = reader.int32(); + break; + } + case 14: { + message.canonicalName = reader.string(); + break; + } + case 15: { + message.mute = reader.int32(); + break; + } + case 17: { + message.findingClass = reader.int32(); + break; + } + case 18: { + message.indicator = $root.google.cloud.securitycenter.v1.Indicator.decode(reader, reader.uint32()); + break; + } + case 20: { + message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.decode(reader, reader.uint32()); + break; + } + case 21: { + message.muteUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 22: { + if (message.externalSystems === $util.emptyObject) + message.externalSystems = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.securitycenter.v1.ExternalSystem.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.externalSystems[key] = value; + break; + } + case 25: { + message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.decode(reader, reader.uint32()); + break; + } + case 26: { + message.access = $root.google.cloud.securitycenter.v1.Access.decode(reader, reader.uint32()); + break; + } + case 31: { + if (!(message.connections && message.connections.length)) + message.connections = []; + message.connections.push($root.google.cloud.securitycenter.v1.Connection.decode(reader, reader.uint32())); + break; + } + case 28: { + message.muteInitiator = reader.string(); + break; + } + case 30: { + if (!(message.processes && message.processes.length)) + message.processes = []; + message.processes.push($root.google.cloud.securitycenter.v1.Process.decode(reader, reader.uint32())); + break; + } + case 33: { + if (message.contacts === $util.emptyObject) + message.contacts = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.securitycenter.v1.ContactDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.contacts[key] = value; + break; + } + case 34: { + if (!(message.compliances && message.compliances.length)) + message.compliances = []; + message.compliances.push($root.google.cloud.securitycenter.v1.Compliance.decode(reader, reader.uint32())); + break; + } + case 36: { + message.parentDisplayName = reader.string(); + break; + } + case 37: { + message.description = reader.string(); + break; + } + case 38: { + message.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.decode(reader, reader.uint32()); + break; + } + case 39: { + if (!(message.iamBindings && message.iamBindings.length)) + message.iamBindings = []; + message.iamBindings.push($root.google.cloud.securitycenter.v1.IamBinding.decode(reader, reader.uint32())); + break; + } + case 40: { + message.nextSteps = reader.string(); + break; + } + case 42: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.securitycenter.v1.Container.decode(reader, reader.uint32())); + break; + } + case 43: { + message.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.decode(reader, reader.uint32()); + break; + } + case 44: { + message.database = $root.google.cloud.securitycenter.v1.Database.decode(reader, reader.uint32()); + break; + } + case 46: { + if (!(message.files && message.files.length)) + message.files = []; + message.files.push($root.google.cloud.securitycenter.v1.File.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.securitycenter.v1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.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.securitycenter.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { + if (!$util.isObject(message.sourceProperties)) + return "sourceProperties: object expected"; + var key = Object.keys(message.sourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (error) + return "sourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + 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.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; + if (message.mute != null && message.hasOwnProperty("mute")) + switch (message.mute) { + default: + return "mute: enum value expected"; + case 0: + case 1: + case 2: + case 4: + break; + } + if (message.findingClass != null && message.hasOwnProperty("findingClass")) + switch (message.findingClass) { + default: + return "findingClass: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.indicator != null && message.hasOwnProperty("indicator")) { + var error = $root.google.cloud.securitycenter.v1.Indicator.verify(message.indicator); + if (error) + return "indicator." + error; + } + if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) { + var error = $root.google.cloud.securitycenter.v1.Vulnerability.verify(message.vulnerability); + if (error) + return "vulnerability." + error; + } + if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.muteUpdateTime); + if (error) + return "muteUpdateTime." + error; + } + if (message.externalSystems != null && message.hasOwnProperty("externalSystems")) { + if (!$util.isObject(message.externalSystems)) + return "externalSystems: object expected"; + var key = Object.keys(message.externalSystems); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ExternalSystem.verify(message.externalSystems[key[i]]); + if (error) + return "externalSystems." + error; + } + } + if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) { + var error = $root.google.cloud.securitycenter.v1.MitreAttack.verify(message.mitreAttack); + if (error) + return "mitreAttack." + error; + } + if (message.access != null && message.hasOwnProperty("access")) { + var error = $root.google.cloud.securitycenter.v1.Access.verify(message.access); + if (error) + return "access." + error; + } + if (message.connections != null && message.hasOwnProperty("connections")) { + if (!Array.isArray(message.connections)) + return "connections: array expected"; + for (var i = 0; i < message.connections.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Connection.verify(message.connections[i]); + if (error) + return "connections." + error; + } + } + if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) + if (!$util.isString(message.muteInitiator)) + return "muteInitiator: string expected"; + if (message.processes != null && message.hasOwnProperty("processes")) { + if (!Array.isArray(message.processes)) + return "processes: array expected"; + for (var i = 0; i < message.processes.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Process.verify(message.processes[i]); + if (error) + return "processes." + error; + } + } + if (message.contacts != null && message.hasOwnProperty("contacts")) { + if (!$util.isObject(message.contacts)) + return "contacts: object expected"; + var key = Object.keys(message.contacts); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ContactDetails.verify(message.contacts[key[i]]); + if (error) + return "contacts." + error; + } + } + if (message.compliances != null && message.hasOwnProperty("compliances")) { + if (!Array.isArray(message.compliances)) + return "compliances: array expected"; + for (var i = 0; i < message.compliances.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Compliance.verify(message.compliances[i]); + if (error) + return "compliances." + error; + } + } + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (!$util.isString(message.parentDisplayName)) + return "parentDisplayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.exfiltration != null && message.hasOwnProperty("exfiltration")) { + var error = $root.google.cloud.securitycenter.v1.Exfiltration.verify(message.exfiltration); + if (error) + return "exfiltration." + error; + } + if (message.iamBindings != null && message.hasOwnProperty("iamBindings")) { + if (!Array.isArray(message.iamBindings)) + return "iamBindings: array expected"; + for (var i = 0; i < message.iamBindings.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.IamBinding.verify(message.iamBindings[i]); + if (error) + return "iamBindings." + error; + } + } + if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) + if (!$util.isString(message.nextSteps)) + return "nextSteps: string expected"; + if (message.containers != null && message.hasOwnProperty("containers")) { + if (!Array.isArray(message.containers)) + return "containers: array expected"; + for (var i = 0; i < message.containers.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + if (message.kubernetes != null && message.hasOwnProperty("kubernetes")) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.verify(message.kubernetes); + if (error) + return "kubernetes." + error; + } + if (message.database != null && message.hasOwnProperty("database")) { + var error = $root.google.cloud.securitycenter.v1.Database.verify(message.database); + if (error) + return "database." + error; + } + if (message.files != null && message.hasOwnProperty("files")) { + if (!Array.isArray(message.files)) + return "files: array expected"; + for (var i = 0; i < message.files.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.File.verify(message.files[i]); + if (error) + return "files." + error; + } + } + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Finding) + return object; + var message = new $root.google.cloud.securitycenter.v1.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.category != null) + message.category = String(object.category); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.sourceProperties) { + if (typeof object.sourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); + message.sourceProperties = {}; + for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.sourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.sourceProperties: object expected"); + message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + 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.canonicalName != null) + message.canonicalName = String(object.canonicalName); + switch (object.mute) { + default: + if (typeof object.mute === "number") { + message.mute = object.mute; + break; + } + break; + case "MUTE_UNSPECIFIED": + case 0: + message.mute = 0; + break; + case "MUTED": + case 1: + message.mute = 1; + break; + case "UNMUTED": + case 2: + message.mute = 2; + break; + case "UNDEFINED": + case 4: + message.mute = 4; + break; + } + switch (object.findingClass) { + default: + if (typeof object.findingClass === "number") { + message.findingClass = object.findingClass; + break; + } + break; + case "FINDING_CLASS_UNSPECIFIED": + case 0: + message.findingClass = 0; + break; + case "THREAT": + case 1: + message.findingClass = 1; + break; + case "VULNERABILITY": + case 2: + message.findingClass = 2; + break; + case "MISCONFIGURATION": + case 3: + message.findingClass = 3; + break; + case "OBSERVATION": + case 4: + message.findingClass = 4; + break; + case "SCC_ERROR": + case 5: + message.findingClass = 5; + break; + } + if (object.indicator != null) { + if (typeof object.indicator !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.indicator: object expected"); + message.indicator = $root.google.cloud.securitycenter.v1.Indicator.fromObject(object.indicator); + } + if (object.vulnerability != null) { + if (typeof object.vulnerability !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.vulnerability: object expected"); + message.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.fromObject(object.vulnerability); + } + if (object.muteUpdateTime != null) { + if (typeof object.muteUpdateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.muteUpdateTime: object expected"); + message.muteUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.muteUpdateTime); + } + if (object.externalSystems) { + if (typeof object.externalSystems !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.externalSystems: object expected"); + message.externalSystems = {}; + for (var keys = Object.keys(object.externalSystems), i = 0; i < keys.length; ++i) { + if (typeof object.externalSystems[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.externalSystems: object expected"); + message.externalSystems[keys[i]] = $root.google.cloud.securitycenter.v1.ExternalSystem.fromObject(object.externalSystems[keys[i]]); + } + } + if (object.mitreAttack != null) { + if (typeof object.mitreAttack !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.mitreAttack: object expected"); + message.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.fromObject(object.mitreAttack); + } + if (object.access != null) { + if (typeof object.access !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.access: object expected"); + message.access = $root.google.cloud.securitycenter.v1.Access.fromObject(object.access); + } + if (object.connections) { + if (!Array.isArray(object.connections)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.connections: array expected"); + message.connections = []; + for (var i = 0; i < object.connections.length; ++i) { + if (typeof object.connections[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.connections: object expected"); + message.connections[i] = $root.google.cloud.securitycenter.v1.Connection.fromObject(object.connections[i]); + } + } + if (object.muteInitiator != null) + message.muteInitiator = String(object.muteInitiator); + if (object.processes) { + if (!Array.isArray(object.processes)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.processes: array expected"); + message.processes = []; + for (var i = 0; i < object.processes.length; ++i) { + if (typeof object.processes[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.processes: object expected"); + message.processes[i] = $root.google.cloud.securitycenter.v1.Process.fromObject(object.processes[i]); + } + } + if (object.contacts) { + if (typeof object.contacts !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.contacts: object expected"); + message.contacts = {}; + for (var keys = Object.keys(object.contacts), i = 0; i < keys.length; ++i) { + if (typeof object.contacts[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.contacts: object expected"); + message.contacts[keys[i]] = $root.google.cloud.securitycenter.v1.ContactDetails.fromObject(object.contacts[keys[i]]); + } + } + if (object.compliances) { + if (!Array.isArray(object.compliances)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.compliances: array expected"); + message.compliances = []; + for (var i = 0; i < object.compliances.length; ++i) { + if (typeof object.compliances[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.compliances: object expected"); + message.compliances[i] = $root.google.cloud.securitycenter.v1.Compliance.fromObject(object.compliances[i]); + } + } + if (object.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); + if (object.description != null) + message.description = String(object.description); + if (object.exfiltration != null) { + if (typeof object.exfiltration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.exfiltration: object expected"); + message.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.fromObject(object.exfiltration); + } + if (object.iamBindings) { + if (!Array.isArray(object.iamBindings)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.iamBindings: array expected"); + message.iamBindings = []; + for (var i = 0; i < object.iamBindings.length; ++i) { + if (typeof object.iamBindings[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.iamBindings: object expected"); + message.iamBindings[i] = $root.google.cloud.securitycenter.v1.IamBinding.fromObject(object.iamBindings[i]); + } + } + if (object.nextSteps != null) + message.nextSteps = String(object.nextSteps); + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.containers: array expected"); + message.containers = []; + for (var i = 0; i < object.containers.length; ++i) { + if (typeof object.containers[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.containers: object expected"); + message.containers[i] = $root.google.cloud.securitycenter.v1.Container.fromObject(object.containers[i]); + } + } + if (object.kubernetes != null) { + if (typeof object.kubernetes !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.kubernetes: object expected"); + message.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.fromObject(object.kubernetes); + } + if (object.database != null) { + if (typeof object.database !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.database: object expected"); + message.database = $root.google.cloud.securitycenter.v1.Database.fromObject(object.database); + } + if (object.files) { + if (!Array.isArray(object.files)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.files: array expected"); + message.files = []; + for (var i = 0; i < object.files.length; ++i) { + if (typeof object.files[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.files: object expected"); + message.files[i] = $root.google.cloud.securitycenter.v1.File.fromObject(object.files[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Finding + * @static + * @param {google.cloud.securitycenter.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.arrays || options.defaults) { + object.processes = []; + object.connections = []; + object.compliances = []; + object.iamBindings = []; + object.containers = []; + object.files = []; + } + if (options.objects || options.defaults) { + object.sourceProperties = {}; + object.externalSystems = {}; + object.contacts = {}; + } + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.resourceName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.category = ""; + object.externalUri = ""; + object.securityMarks = null; + object.eventTime = null; + object.createTime = null; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.canonicalName = ""; + object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; + object.findingClass = options.enums === String ? "FINDING_CLASS_UNSPECIFIED" : 0; + object.indicator = null; + object.vulnerability = null; + object.muteUpdateTime = null; + object.mitreAttack = null; + object.access = null; + object.muteInitiator = ""; + object.parentDisplayName = ""; + object.description = ""; + object.exfiltration = null; + object.nextSteps = ""; + object.kubernetes = null; + object.database = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + var keys2; + if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { + object.sourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.securitycenter.v1.Finding.Severity[message.severity] : message.severity; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + if (message.mute != null && message.hasOwnProperty("mute")) + object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] === undefined ? message.mute : $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; + if (message.findingClass != null && message.hasOwnProperty("findingClass")) + object.findingClass = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.FindingClass[message.findingClass] === undefined ? message.findingClass : $root.google.cloud.securitycenter.v1.Finding.FindingClass[message.findingClass] : message.findingClass; + if (message.indicator != null && message.hasOwnProperty("indicator")) + object.indicator = $root.google.cloud.securitycenter.v1.Indicator.toObject(message.indicator, options); + if (message.vulnerability != null && message.hasOwnProperty("vulnerability")) + object.vulnerability = $root.google.cloud.securitycenter.v1.Vulnerability.toObject(message.vulnerability, options); + if (message.muteUpdateTime != null && message.hasOwnProperty("muteUpdateTime")) + object.muteUpdateTime = $root.google.protobuf.Timestamp.toObject(message.muteUpdateTime, options); + if (message.externalSystems && (keys2 = Object.keys(message.externalSystems)).length) { + object.externalSystems = {}; + for (var j = 0; j < keys2.length; ++j) + object.externalSystems[keys2[j]] = $root.google.cloud.securitycenter.v1.ExternalSystem.toObject(message.externalSystems[keys2[j]], options); + } + if (message.mitreAttack != null && message.hasOwnProperty("mitreAttack")) + object.mitreAttack = $root.google.cloud.securitycenter.v1.MitreAttack.toObject(message.mitreAttack, options); + if (message.access != null && message.hasOwnProperty("access")) + object.access = $root.google.cloud.securitycenter.v1.Access.toObject(message.access, options); + if (message.muteInitiator != null && message.hasOwnProperty("muteInitiator")) + object.muteInitiator = message.muteInitiator; + if (message.processes && message.processes.length) { + object.processes = []; + for (var j = 0; j < message.processes.length; ++j) + object.processes[j] = $root.google.cloud.securitycenter.v1.Process.toObject(message.processes[j], options); + } + if (message.connections && message.connections.length) { + object.connections = []; + for (var j = 0; j < message.connections.length; ++j) + object.connections[j] = $root.google.cloud.securitycenter.v1.Connection.toObject(message.connections[j], options); + } + if (message.contacts && (keys2 = Object.keys(message.contacts)).length) { + object.contacts = {}; + for (var j = 0; j < keys2.length; ++j) + object.contacts[keys2[j]] = $root.google.cloud.securitycenter.v1.ContactDetails.toObject(message.contacts[keys2[j]], options); + } + if (message.compliances && message.compliances.length) { + object.compliances = []; + for (var j = 0; j < message.compliances.length; ++j) + object.compliances[j] = $root.google.cloud.securitycenter.v1.Compliance.toObject(message.compliances[j], options); + } + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + object.parentDisplayName = message.parentDisplayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.exfiltration != null && message.hasOwnProperty("exfiltration")) + object.exfiltration = $root.google.cloud.securitycenter.v1.Exfiltration.toObject(message.exfiltration, options); + if (message.iamBindings && message.iamBindings.length) { + object.iamBindings = []; + for (var j = 0; j < message.iamBindings.length; ++j) + object.iamBindings[j] = $root.google.cloud.securitycenter.v1.IamBinding.toObject(message.iamBindings[j], options); + } + if (message.nextSteps != null && message.hasOwnProperty("nextSteps")) + object.nextSteps = message.nextSteps; + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.securitycenter.v1.Container.toObject(message.containers[j], options); + } + if (message.kubernetes != null && message.hasOwnProperty("kubernetes")) + object.kubernetes = $root.google.cloud.securitycenter.v1.Kubernetes.toObject(message.kubernetes, options); + if (message.database != null && message.hasOwnProperty("database")) + object.database = $root.google.cloud.securitycenter.v1.Database.toObject(message.database, options); + if (message.files && message.files.length) { + object.files = []; + for (var j = 0; j < message.files.length; ++j) + object.files[j] = $root.google.cloud.securitycenter.v1.File.toObject(message.files[j], options); + } + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.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.securitycenter.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.securitycenter.v1.Finding"; + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1.Finding.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + */ + Finding.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + return values; + })(); + + /** + * Severity enum. + * @name google.cloud.securitycenter.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; + })(); + + /** + * Mute enum. + * @name google.cloud.securitycenter.v1.Finding.Mute + * @enum {number} + * @property {number} MUTE_UNSPECIFIED=0 MUTE_UNSPECIFIED value + * @property {number} MUTED=1 MUTED value + * @property {number} UNMUTED=2 UNMUTED value + * @property {number} UNDEFINED=4 UNDEFINED value + */ + Finding.Mute = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MUTE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MUTED"] = 1; + values[valuesById[2] = "UNMUTED"] = 2; + values[valuesById[4] = "UNDEFINED"] = 4; + return values; + })(); + + /** + * FindingClass enum. + * @name google.cloud.securitycenter.v1.Finding.FindingClass + * @enum {number} + * @property {number} FINDING_CLASS_UNSPECIFIED=0 FINDING_CLASS_UNSPECIFIED value + * @property {number} THREAT=1 THREAT value + * @property {number} VULNERABILITY=2 VULNERABILITY value + * @property {number} MISCONFIGURATION=3 MISCONFIGURATION value + * @property {number} OBSERVATION=4 OBSERVATION value + * @property {number} SCC_ERROR=5 SCC_ERROR value + */ + Finding.FindingClass = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FINDING_CLASS_UNSPECIFIED"] = 0; + values[valuesById[1] = "THREAT"] = 1; + values[valuesById[2] = "VULNERABILITY"] = 2; + values[valuesById[3] = "MISCONFIGURATION"] = 3; + values[valuesById[4] = "OBSERVATION"] = 4; + values[valuesById[5] = "SCC_ERROR"] = 5; + return values; + })(); + + return Finding; + })(); + + v1.IamBinding = (function() { + + /** + * Properties of an IamBinding. + * @memberof google.cloud.securitycenter.v1 + * @interface IIamBinding + * @property {google.cloud.securitycenter.v1.IamBinding.Action|null} [action] IamBinding action + * @property {string|null} [role] IamBinding role + * @property {string|null} [member] IamBinding member + */ + + /** + * Constructs a new IamBinding. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an IamBinding. + * @implements IIamBinding + * @constructor + * @param {google.cloud.securitycenter.v1.IIamBinding=} [properties] Properties to set + */ + function IamBinding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IamBinding action. + * @member {google.cloud.securitycenter.v1.IamBinding.Action} action + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + */ + IamBinding.prototype.action = 0; + + /** + * IamBinding role. + * @member {string} role + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + */ + IamBinding.prototype.role = ""; + + /** + * IamBinding member. + * @member {string} member + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + */ + IamBinding.prototype.member = ""; + + /** + * Creates a new IamBinding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IIamBinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding instance + */ + IamBinding.create = function create(properties) { + return new IamBinding(properties); + }; + + /** + * Encodes the specified IamBinding message. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IIamBinding} message IamBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamBinding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + return writer; + }; + + /** + * Encodes the specified IamBinding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.IamBinding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IIamBinding} message IamBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamBinding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamBinding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamBinding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.IamBinding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamBinding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamBinding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamBinding message. + * @function verify + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamBinding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + return null; + }; + + /** + * Creates an IamBinding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.IamBinding} IamBinding + */ + IamBinding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.IamBinding) + return object; + var message = new $root.google.cloud.securitycenter.v1.IamBinding(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + return message; + }; + + /** + * Creates a plain object from an IamBinding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {google.cloud.securitycenter.v1.IamBinding} message IamBinding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamBinding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.cloud.securitycenter.v1.IamBinding.Action[message.action] === undefined ? message.action : $root.google.cloud.securitycenter.v1.IamBinding.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + return object; + }; + + /** + * Converts this IamBinding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.IamBinding + * @instance + * @returns {Object.} JSON object + */ + IamBinding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IamBinding + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.IamBinding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamBinding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.IamBinding"; + }; + + /** + * Action enum. + * @name google.cloud.securitycenter.v1.IamBinding.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + IamBinding.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return IamBinding; + })(); + + v1.Indicator = (function() { + + /** + * Properties of an Indicator. + * @memberof google.cloud.securitycenter.v1 + * @interface IIndicator + * @property {Array.|null} [ipAddresses] Indicator ipAddresses + * @property {Array.|null} [domains] Indicator domains + * @property {Array.|null} [signatures] Indicator signatures + * @property {Array.|null} [uris] Indicator uris + */ + + /** + * Constructs a new Indicator. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an Indicator. + * @implements IIndicator + * @constructor + * @param {google.cloud.securitycenter.v1.IIndicator=} [properties] Properties to set + */ + function Indicator(properties) { + this.ipAddresses = []; + this.domains = []; + this.signatures = []; + this.uris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Indicator ipAddresses. + * @member {Array.} ipAddresses + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + */ + Indicator.prototype.ipAddresses = $util.emptyArray; + + /** + * Indicator domains. + * @member {Array.} domains + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + */ + Indicator.prototype.domains = $util.emptyArray; + + /** + * Indicator signatures. + * @member {Array.} signatures + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + */ + Indicator.prototype.signatures = $util.emptyArray; + + /** + * Indicator uris. + * @member {Array.} uris + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + */ + Indicator.prototype.uris = $util.emptyArray; + + /** + * Creates a new Indicator instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.IIndicator=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator instance + */ + Indicator.create = function create(properties) { + return new Indicator(properties); + }; + + /** + * Encodes the specified Indicator message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Indicator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipAddresses != null && message.ipAddresses.length) + for (var i = 0; i < message.ipAddresses.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipAddresses[i]); + if (message.domains != null && message.domains.length) + for (var i = 0; i < message.domains.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.domains[i]); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.encode(message.signatures[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.uris[i]); + return writer; + }; + + /** + * Encodes the specified Indicator message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.IIndicator} message Indicator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Indicator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Indicator message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Indicator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Indicator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ipAddresses && message.ipAddresses.length)) + message.ipAddresses = []; + message.ipAddresses.push(reader.string()); + break; + } + case 2: { + if (!(message.domains && message.domains.length)) + message.domains = []; + message.domains.push(reader.string()); + break; + } + case 3: { + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Indicator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Indicator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Indicator message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Indicator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (!Array.isArray(message.ipAddresses)) + return "ipAddresses: array expected"; + for (var i = 0; i < message.ipAddresses.length; ++i) + if (!$util.isString(message.ipAddresses[i])) + return "ipAddresses: string[] expected"; + } + if (message.domains != null && message.hasOwnProperty("domains")) { + if (!Array.isArray(message.domains)) + return "domains: array expected"; + for (var i = 0; i < message.domains.length; ++i) + if (!$util.isString(message.domains[i])) + return "domains: string[] expected"; + } + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify(message.signatures[i]); + if (error) + return "signatures." + error; + } + } + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } + return null; + }; + + /** + * Creates an Indicator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator} Indicator + */ + Indicator.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator(); + if (object.ipAddresses) { + if (!Array.isArray(object.ipAddresses)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ipAddresses: array expected"); + message.ipAddresses = []; + for (var i = 0; i < object.ipAddresses.length; ++i) + message.ipAddresses[i] = String(object.ipAddresses[i]); + } + if (object.domains) { + if (!Array.isArray(object.domains)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.domains: array expected"); + message.domains = []; + for (var i = 0; i < object.domains.length; ++i) + message.domains[i] = String(object.domains[i]); + } + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Indicator.signatures: object expected"); + message.signatures[i] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.fromObject(object.signatures[i]); + } + } + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } + return message; + }; + + /** + * Creates a plain object from an Indicator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {google.cloud.securitycenter.v1.Indicator} message Indicator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Indicator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ipAddresses = []; + object.domains = []; + object.signatures = []; + object.uris = []; + } + if (message.ipAddresses && message.ipAddresses.length) { + object.ipAddresses = []; + for (var j = 0; j < message.ipAddresses.length; ++j) + object.ipAddresses[j] = message.ipAddresses[j]; + } + if (message.domains && message.domains.length) { + object.domains = []; + for (var j = 0; j < message.domains.length; ++j) + object.domains[j] = message.domains[j]; + } + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.toObject(message.signatures[j], options); + } + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } + return object; + }; + + /** + * Converts this Indicator to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator + * @instance + * @returns {Object.} JSON object + */ + Indicator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Indicator + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Indicator + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Indicator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Indicator"; + }; + + Indicator.ProcessSignature = (function() { + + /** + * Properties of a ProcessSignature. + * @memberof google.cloud.securitycenter.v1.Indicator + * @interface IProcessSignature + * @property {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature|null} [memoryHashSignature] ProcessSignature memoryHashSignature + * @property {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature|null} [yaraRuleSignature] ProcessSignature yaraRuleSignature + */ + + /** + * Constructs a new ProcessSignature. + * @memberof google.cloud.securitycenter.v1.Indicator + * @classdesc Represents a ProcessSignature. + * @implements IProcessSignature + * @constructor + * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature=} [properties] Properties to set + */ + function ProcessSignature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessSignature memoryHashSignature. + * @member {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature|null|undefined} memoryHashSignature + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @instance + */ + ProcessSignature.prototype.memoryHashSignature = null; + + /** + * ProcessSignature yaraRuleSignature. + * @member {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature|null|undefined} yaraRuleSignature + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @instance + */ + ProcessSignature.prototype.yaraRuleSignature = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProcessSignature signature. + * @member {"memoryHashSignature"|"yaraRuleSignature"|undefined} signature + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @instance + */ + Object.defineProperty(ProcessSignature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["memoryHashSignature", "yaraRuleSignature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProcessSignature instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature instance + */ + ProcessSignature.create = function create(properties) { + return new ProcessSignature(properties); + }; + + /** + * Encodes the specified ProcessSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature} message ProcessSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessSignature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memoryHashSignature != null && Object.hasOwnProperty.call(message, "memoryHashSignature")) + $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.encode(message.memoryHashSignature, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.yaraRuleSignature != null && Object.hasOwnProperty.call(message, "yaraRuleSignature")) + $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.encode(message.yaraRuleSignature, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProcessSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.IProcessSignature} message ProcessSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessSignature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessSignature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessSignature.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6: { + message.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.decode(reader, reader.uint32()); + break; + } + case 7: { + message.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessSignature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessSignature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessSignature message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessSignature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.memoryHashSignature != null && message.hasOwnProperty("memoryHashSignature")) { + properties.signature = 1; + { + var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify(message.memoryHashSignature); + if (error) + return "memoryHashSignature." + error; + } + } + if (message.yaraRuleSignature != null && message.hasOwnProperty("yaraRuleSignature")) { + if (properties.signature === 1) + return "signature: multiple values"; + properties.signature = 1; + { + var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify(message.yaraRuleSignature); + if (error) + return "yaraRuleSignature." + error; + } + } + return null; + }; + + /** + * Creates a ProcessSignature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature} ProcessSignature + */ + ProcessSignature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature(); + if (object.memoryHashSignature != null) { + if (typeof object.memoryHashSignature !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.memoryHashSignature: object expected"); + message.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.fromObject(object.memoryHashSignature); + } + if (object.yaraRuleSignature != null) { + if (typeof object.yaraRuleSignature !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.yaraRuleSignature: object expected"); + message.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.fromObject(object.yaraRuleSignature); + } + return message; + }; + + /** + * Creates a plain object from a ProcessSignature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature} message ProcessSignature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessSignature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.memoryHashSignature != null && message.hasOwnProperty("memoryHashSignature")) { + object.memoryHashSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.toObject(message.memoryHashSignature, options); + if (options.oneofs) + object.signature = "memoryHashSignature"; + } + if (message.yaraRuleSignature != null && message.hasOwnProperty("yaraRuleSignature")) { + object.yaraRuleSignature = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.toObject(message.yaraRuleSignature, options); + if (options.oneofs) + object.signature = "yaraRuleSignature"; + } + return object; + }; + + /** + * Converts this ProcessSignature to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @instance + * @returns {Object.} JSON object + */ + ProcessSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessSignature + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Indicator.ProcessSignature"; + }; + + ProcessSignature.MemoryHashSignature = (function() { + + /** + * Properties of a MemoryHashSignature. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @interface IMemoryHashSignature + * @property {string|null} [binaryFamily] MemoryHashSignature binaryFamily + * @property {Array.|null} [detections] MemoryHashSignature detections + */ + + /** + * Constructs a new MemoryHashSignature. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @classdesc Represents a MemoryHashSignature. + * @implements IMemoryHashSignature + * @constructor + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature=} [properties] Properties to set + */ + function MemoryHashSignature(properties) { + this.detections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MemoryHashSignature binaryFamily. + * @member {string} binaryFamily + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @instance + */ + MemoryHashSignature.prototype.binaryFamily = ""; + + /** + * MemoryHashSignature detections. + * @member {Array.} detections + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @instance + */ + MemoryHashSignature.prototype.detections = $util.emptyArray; + + /** + * Creates a new MemoryHashSignature instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature instance + */ + MemoryHashSignature.create = function create(properties) { + return new MemoryHashSignature(properties); + }; + + /** + * Encodes the specified MemoryHashSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature} message MemoryHashSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemoryHashSignature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.binaryFamily != null && Object.hasOwnProperty.call(message, "binaryFamily")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.binaryFamily); + if (message.detections != null && message.detections.length) + for (var i = 0; i < message.detections.length; ++i) + $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.encode(message.detections[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MemoryHashSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IMemoryHashSignature} message MemoryHashSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemoryHashSignature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MemoryHashSignature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemoryHashSignature.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.binaryFamily = reader.string(); + break; + } + case 4: { + if (!(message.detections && message.detections.length)) + message.detections = []; + message.detections.push($root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MemoryHashSignature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemoryHashSignature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MemoryHashSignature message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MemoryHashSignature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.binaryFamily != null && message.hasOwnProperty("binaryFamily")) + if (!$util.isString(message.binaryFamily)) + return "binaryFamily: string expected"; + if (message.detections != null && message.hasOwnProperty("detections")) { + if (!Array.isArray(message.detections)) + return "detections: array expected"; + for (var i = 0; i < message.detections.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify(message.detections[i]); + if (error) + return "detections." + error; + } + } + return null; + }; + + /** + * Creates a MemoryHashSignature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} MemoryHashSignature + */ + MemoryHashSignature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature(); + if (object.binaryFamily != null) + message.binaryFamily = String(object.binaryFamily); + if (object.detections) { + if (!Array.isArray(object.detections)) + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.detections: array expected"); + message.detections = []; + for (var i = 0; i < object.detections.length; ++i) { + if (typeof object.detections[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.detections: object expected"); + message.detections[i] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.fromObject(object.detections[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MemoryHashSignature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature} message MemoryHashSignature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MemoryHashSignature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detections = []; + if (options.defaults) + object.binaryFamily = ""; + if (message.binaryFamily != null && message.hasOwnProperty("binaryFamily")) + object.binaryFamily = message.binaryFamily; + if (message.detections && message.detections.length) { + object.detections = []; + for (var j = 0; j < message.detections.length; ++j) + object.detections[j] = $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.toObject(message.detections[j], options); + } + return object; + }; + + /** + * Converts this MemoryHashSignature to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @instance + * @returns {Object.} JSON object + */ + MemoryHashSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MemoryHashSignature + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MemoryHashSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature"; + }; + + MemoryHashSignature.Detection = (function() { + + /** + * Properties of a Detection. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @interface IDetection + * @property {string|null} [binary] Detection binary + * @property {number|null} [percentPagesMatched] Detection percentPagesMatched + */ + + /** + * Constructs a new Detection. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature + * @classdesc Represents a Detection. + * @implements IDetection + * @constructor + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection=} [properties] Properties to set + */ + function Detection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Detection binary. + * @member {string} binary + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @instance + */ + Detection.prototype.binary = ""; + + /** + * Detection percentPagesMatched. + * @member {number} percentPagesMatched + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @instance + */ + Detection.prototype.percentPagesMatched = 0; + + /** + * Creates a new Detection instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection instance + */ + Detection.create = function create(properties) { + return new Detection(properties); + }; + + /** + * Encodes the specified Detection message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection} message Detection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Detection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.binary != null && Object.hasOwnProperty.call(message, "binary")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.binary); + if (message.percentPagesMatched != null && Object.hasOwnProperty.call(message, "percentPagesMatched")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.percentPagesMatched); + return writer; + }; + + /** + * Encodes the specified Detection message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.IDetection} message Detection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Detection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Detection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Detection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.binary = reader.string(); + break; + } + case 3: { + message.percentPagesMatched = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Detection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Detection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Detection message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Detection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.binary != null && message.hasOwnProperty("binary")) + if (!$util.isString(message.binary)) + return "binary: string expected"; + if (message.percentPagesMatched != null && message.hasOwnProperty("percentPagesMatched")) + if (typeof message.percentPagesMatched !== "number") + return "percentPagesMatched: number expected"; + return null; + }; + + /** + * Creates a Detection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} Detection + */ + Detection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection(); + if (object.binary != null) + message.binary = String(object.binary); + if (object.percentPagesMatched != null) + message.percentPagesMatched = Number(object.percentPagesMatched); + return message; + }; + + /** + * Creates a plain object from a Detection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection} message Detection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Detection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.binary = ""; + object.percentPagesMatched = 0; + } + if (message.binary != null && message.hasOwnProperty("binary")) + object.binary = message.binary; + if (message.percentPagesMatched != null && message.hasOwnProperty("percentPagesMatched")) + object.percentPagesMatched = options.json && !isFinite(message.percentPagesMatched) ? String(message.percentPagesMatched) : message.percentPagesMatched; + return object; + }; + + /** + * Converts this Detection to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @instance + * @returns {Object.} JSON object + */ + Detection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Detection + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Detection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection"; + }; + + return Detection; + })(); + + return MemoryHashSignature; + })(); + + ProcessSignature.YaraRuleSignature = (function() { + + /** + * Properties of a YaraRuleSignature. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @interface IYaraRuleSignature + * @property {string|null} [yaraRule] YaraRuleSignature yaraRule + */ + + /** + * Constructs a new YaraRuleSignature. + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature + * @classdesc Represents a YaraRuleSignature. + * @implements IYaraRuleSignature + * @constructor + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature=} [properties] Properties to set + */ + function YaraRuleSignature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * YaraRuleSignature yaraRule. + * @member {string} yaraRule + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @instance + */ + YaraRuleSignature.prototype.yaraRule = ""; + + /** + * Creates a new YaraRuleSignature instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature instance + */ + YaraRuleSignature.create = function create(properties) { + return new YaraRuleSignature(properties); + }; + + /** + * Encodes the specified YaraRuleSignature message. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature} message YaraRuleSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YaraRuleSignature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.yaraRule != null && Object.hasOwnProperty.call(message, "yaraRule")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.yaraRule); + return writer; + }; + + /** + * Encodes the specified YaraRuleSignature message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.IYaraRuleSignature} message YaraRuleSignature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YaraRuleSignature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a YaraRuleSignature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YaraRuleSignature.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.yaraRule = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a YaraRuleSignature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YaraRuleSignature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a YaraRuleSignature message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + YaraRuleSignature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.yaraRule != null && message.hasOwnProperty("yaraRule")) + if (!$util.isString(message.yaraRule)) + return "yaraRule: string expected"; + return null; + }; + + /** + * Creates a YaraRuleSignature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} YaraRuleSignature + */ + YaraRuleSignature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature) + return object; + var message = new $root.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature(); + if (object.yaraRule != null) + message.yaraRule = String(object.yaraRule); + return message; + }; + + /** + * Creates a plain object from a YaraRuleSignature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature} message YaraRuleSignature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + YaraRuleSignature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.yaraRule = ""; + if (message.yaraRule != null && message.hasOwnProperty("yaraRule")) + object.yaraRule = message.yaraRule; + return object; + }; + + /** + * Converts this YaraRuleSignature to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @instance + * @returns {Object.} JSON object + */ + YaraRuleSignature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for YaraRuleSignature + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + YaraRuleSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature"; + }; + + return YaraRuleSignature; + })(); + + return ProcessSignature; + })(); + + return Indicator; + })(); + + v1.Kubernetes = (function() { + + /** + * Properties of a Kubernetes. + * @memberof google.cloud.securitycenter.v1 + * @interface IKubernetes + * @property {Array.|null} [pods] Kubernetes pods + * @property {Array.|null} [nodes] Kubernetes nodes + * @property {Array.|null} [nodePools] Kubernetes nodePools + * @property {Array.|null} [roles] Kubernetes roles + * @property {Array.|null} [bindings] Kubernetes bindings + * @property {Array.|null} [accessReviews] Kubernetes accessReviews + */ + + /** + * Constructs a new Kubernetes. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Kubernetes. + * @implements IKubernetes + * @constructor + * @param {google.cloud.securitycenter.v1.IKubernetes=} [properties] Properties to set + */ + function Kubernetes(properties) { + this.pods = []; + this.nodes = []; + this.nodePools = []; + this.roles = []; + this.bindings = []; + this.accessReviews = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Kubernetes pods. + * @member {Array.} pods + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + */ + Kubernetes.prototype.pods = $util.emptyArray; + + /** + * Kubernetes nodes. + * @member {Array.} nodes + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + */ + Kubernetes.prototype.nodes = $util.emptyArray; + + /** + * Kubernetes nodePools. + * @member {Array.} nodePools + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + */ + Kubernetes.prototype.nodePools = $util.emptyArray; + + /** + * Kubernetes roles. + * @member {Array.} roles + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + */ + Kubernetes.prototype.roles = $util.emptyArray; + + /** + * Kubernetes bindings. + * @member {Array.} bindings + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + */ + Kubernetes.prototype.bindings = $util.emptyArray; + + /** + * Kubernetes accessReviews. + * @member {Array.} accessReviews + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + */ + Kubernetes.prototype.accessReviews = $util.emptyArray; + + /** + * Creates a new Kubernetes instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {google.cloud.securitycenter.v1.IKubernetes=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes} Kubernetes instance + */ + Kubernetes.create = function create(properties) { + return new Kubernetes(properties); + }; + + /** + * Encodes the specified Kubernetes message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {google.cloud.securitycenter.v1.IKubernetes} message Kubernetes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Kubernetes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pods != null && message.pods.length) + for (var i = 0; i < message.pods.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.Pod.encode(message.pods[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.Node.encode(message.nodes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nodePools != null && message.nodePools.length) + for (var i = 0; i < message.nodePools.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.NodePool.encode(message.nodePools[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.Role.encode(message.roles[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.Binding.encode(message.bindings[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.accessReviews != null && message.accessReviews.length) + for (var i = 0; i < message.accessReviews.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.AccessReview.encode(message.accessReviews[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Kubernetes message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {google.cloud.securitycenter.v1.IKubernetes} message Kubernetes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Kubernetes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Kubernetes message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes} Kubernetes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Kubernetes.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Kubernetes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.pods && message.pods.length)) + message.pods = []; + message.pods.push($root.google.cloud.securitycenter.v1.Kubernetes.Pod.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.securitycenter.v1.Kubernetes.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nodePools && message.nodePools.length)) + message.nodePools = []; + message.nodePools.push($root.google.cloud.securitycenter.v1.Kubernetes.NodePool.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push($root.google.cloud.securitycenter.v1.Kubernetes.Role.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.cloud.securitycenter.v1.Kubernetes.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.accessReviews && message.accessReviews.length)) + message.accessReviews = []; + message.accessReviews.push($root.google.cloud.securitycenter.v1.Kubernetes.AccessReview.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Kubernetes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes} Kubernetes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Kubernetes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Kubernetes message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Kubernetes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pods != null && message.hasOwnProperty("pods")) { + if (!Array.isArray(message.pods)) + return "pods: array expected"; + for (var i = 0; i < message.pods.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Pod.verify(message.pods[i]); + if (error) + return "pods." + error; + } + } + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Node.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + if (message.nodePools != null && message.hasOwnProperty("nodePools")) { + if (!Array.isArray(message.nodePools)) + return "nodePools: array expected"; + for (var i = 0; i < message.nodePools.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.NodePool.verify(message.nodePools[i]); + if (error) + return "nodePools." + error; + } + } + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Role.verify(message.roles[i]); + if (error) + return "roles." + error; + } + } + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.accessReviews != null && message.hasOwnProperty("accessReviews")) { + if (!Array.isArray(message.accessReviews)) + return "accessReviews: array expected"; + for (var i = 0; i < message.accessReviews.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.AccessReview.verify(message.accessReviews[i]); + if (error) + return "accessReviews." + error; + } + } + return null; + }; + + /** + * Creates a Kubernetes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes} Kubernetes + */ + Kubernetes.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes(); + if (object.pods) { + if (!Array.isArray(object.pods)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.pods: array expected"); + message.pods = []; + for (var i = 0; i < object.pods.length; ++i) { + if (typeof object.pods[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.pods: object expected"); + message.pods[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Pod.fromObject(object.pods[i]); + } + } + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) { + if (typeof object.nodes[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.nodes: object expected"); + message.nodes[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Node.fromObject(object.nodes[i]); + } + } + if (object.nodePools) { + if (!Array.isArray(object.nodePools)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.nodePools: array expected"); + message.nodePools = []; + for (var i = 0; i < object.nodePools.length; ++i) { + if (typeof object.nodePools[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.nodePools: object expected"); + message.nodePools[i] = $root.google.cloud.securitycenter.v1.Kubernetes.NodePool.fromObject(object.nodePools[i]); + } + } + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) { + if (typeof object.roles[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.roles: object expected"); + message.roles[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Role.fromObject(object.roles[i]); + } + } + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.bindings: object expected"); + message.bindings[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Binding.fromObject(object.bindings[i]); + } + } + if (object.accessReviews) { + if (!Array.isArray(object.accessReviews)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.accessReviews: array expected"); + message.accessReviews = []; + for (var i = 0; i < object.accessReviews.length; ++i) { + if (typeof object.accessReviews[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.accessReviews: object expected"); + message.accessReviews[i] = $root.google.cloud.securitycenter.v1.Kubernetes.AccessReview.fromObject(object.accessReviews[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Kubernetes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes} message Kubernetes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Kubernetes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pods = []; + object.nodes = []; + object.nodePools = []; + object.roles = []; + object.bindings = []; + object.accessReviews = []; + } + if (message.pods && message.pods.length) { + object.pods = []; + for (var j = 0; j < message.pods.length; ++j) + object.pods[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Pod.toObject(message.pods[j], options); + } + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Node.toObject(message.nodes[j], options); + } + if (message.nodePools && message.nodePools.length) { + object.nodePools = []; + for (var j = 0; j < message.nodePools.length; ++j) + object.nodePools[j] = $root.google.cloud.securitycenter.v1.Kubernetes.NodePool.toObject(message.nodePools[j], options); + } + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Role.toObject(message.roles[j], options); + } + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Binding.toObject(message.bindings[j], options); + } + if (message.accessReviews && message.accessReviews.length) { + object.accessReviews = []; + for (var j = 0; j < message.accessReviews.length; ++j) + object.accessReviews[j] = $root.google.cloud.securitycenter.v1.Kubernetes.AccessReview.toObject(message.accessReviews[j], options); + } + return object; + }; + + /** + * Converts this Kubernetes to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @instance + * @returns {Object.} JSON object + */ + Kubernetes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Kubernetes + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Kubernetes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes"; + }; + + Kubernetes.Pod = (function() { + + /** + * Properties of a Pod. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface IPod + * @property {string|null} [ns] Pod ns + * @property {string|null} [name] Pod name + * @property {Array.|null} [labels] Pod labels + * @property {Array.|null} [containers] Pod containers + */ + + /** + * Constructs a new Pod. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents a Pod. + * @implements IPod + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.IPod=} [properties] Properties to set + */ + function Pod(properties) { + this.labels = []; + this.containers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Pod ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @instance + */ + Pod.prototype.ns = ""; + + /** + * Pod name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @instance + */ + Pod.prototype.name = ""; + + /** + * Pod labels. + * @member {Array.} labels + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @instance + */ + Pod.prototype.labels = $util.emptyArray; + + /** + * Pod containers. + * @member {Array.} containers + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @instance + */ + Pod.prototype.containers = $util.emptyArray; + + /** + * Creates a new Pod instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IPod=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.Pod} Pod instance + */ + Pod.create = function create(properties) { + return new Pod(properties); + }; + + /** + * Encodes the specified Pod message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Pod.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IPod} message Pod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pod.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ns); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + $root.google.cloud.securitycenter.v1.Label.encode(message.labels[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.securitycenter.v1.Container.encode(message.containers[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Pod message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Pod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IPod} message Pod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Pod message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes.Pod} Pod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pod.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Kubernetes.Pod(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ns = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push($root.google.cloud.securitycenter.v1.Label.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.securitycenter.v1.Container.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Pod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.Pod} Pod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Pod message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Pod.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ns != null && message.hasOwnProperty("ns")) + if (!$util.isString(message.ns)) + return "ns: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Label.verify(message.labels[i]); + if (error) + return "labels." + error; + } + } + if (message.containers != null && message.hasOwnProperty("containers")) { + if (!Array.isArray(message.containers)) + return "containers: array expected"; + for (var i = 0; i < message.containers.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + return null; + }; + + /** + * Creates a Pod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.Pod} Pod + */ + Pod.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.Pod) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Pod(); + if (object.ns != null) + message.ns = String(object.ns); + if (object.name != null) + message.name = String(object.name); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Pod.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) { + if (typeof object.labels[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Pod.labels: object expected"); + message.labels[i] = $root.google.cloud.securitycenter.v1.Label.fromObject(object.labels[i]); + } + } + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Pod.containers: array expected"); + message.containers = []; + for (var i = 0; i < object.containers.length; ++i) { + if (typeof object.containers[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Pod.containers: object expected"); + message.containers[i] = $root.google.cloud.securitycenter.v1.Container.fromObject(object.containers[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Pod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.Pod} message Pod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Pod.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.labels = []; + object.containers = []; + } + if (options.defaults) { + object.ns = ""; + object.name = ""; + } + if (message.ns != null && message.hasOwnProperty("ns")) + object.ns = message.ns; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = $root.google.cloud.securitycenter.v1.Label.toObject(message.labels[j], options); + } + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.securitycenter.v1.Container.toObject(message.containers[j], options); + } + return object; + }; + + /** + * Converts this Pod to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @instance + * @returns {Object.} JSON object + */ + Pod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Pod + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.Pod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Pod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.Pod"; + }; + + return Pod; + })(); + + Kubernetes.Node = (function() { + + /** + * Properties of a Node. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface INode + * @property {string|null} [name] Node name + */ + + /** + * Constructs a new Node. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.INode=} [properties] Properties to set + */ + function Node(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Node name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @instance + */ + Node.prototype.name = ""; + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.INode=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + 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 Node message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Kubernetes.Node(); + 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 Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (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 Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.Node) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Node(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.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 Node to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.Node"; + }; + + return Node; + })(); + + Kubernetes.NodePool = (function() { + + /** + * Properties of a NodePool. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface INodePool + * @property {string|null} [name] NodePool name + * @property {Array.|null} [nodes] NodePool nodes + */ + + /** + * Constructs a new NodePool. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents a NodePool. + * @implements INodePool + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.INodePool=} [properties] Properties to set + */ + function NodePool(properties) { + this.nodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodePool name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @instance + */ + NodePool.prototype.name = ""; + + /** + * NodePool nodes. + * @member {Array.} nodes + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @instance + */ + NodePool.prototype.nodes = $util.emptyArray; + + /** + * Creates a new NodePool instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.INodePool=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.NodePool} NodePool instance + */ + NodePool.create = function create(properties) { + return new NodePool(properties); + }; + + /** + * Encodes the specified NodePool message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.NodePool.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.INodePool} message NodePool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodePool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.Node.encode(message.nodes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodePool message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.NodePool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.INodePool} message NodePool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodePool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodePool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes.NodePool} NodePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodePool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Kubernetes.NodePool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.securitycenter.v1.Kubernetes.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodePool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.NodePool} NodePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodePool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodePool message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodePool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Node.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + return null; + }; + + /** + * Creates a NodePool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.NodePool} NodePool + */ + NodePool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.NodePool) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.NodePool(); + if (object.name != null) + message.name = String(object.name); + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.NodePool.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) { + if (typeof object.nodes[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.NodePool.nodes: object expected"); + message.nodes[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Node.fromObject(object.nodes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NodePool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.NodePool} message NodePool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodePool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodes = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Node.toObject(message.nodes[j], options); + } + return object; + }; + + /** + * Converts this NodePool to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @instance + * @returns {Object.} JSON object + */ + NodePool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodePool + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.NodePool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodePool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.NodePool"; + }; + + return NodePool; + })(); + + Kubernetes.Role = (function() { + + /** + * Properties of a Role. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface IRole + * @property {google.cloud.securitycenter.v1.Kubernetes.Role.Kind|null} [kind] Role kind + * @property {string|null} [ns] Role ns + * @property {string|null} [name] Role name + */ + + /** + * Constructs a new Role. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents a Role. + * @implements IRole + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.IRole=} [properties] Properties to set + */ + function Role(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Role kind. + * @member {google.cloud.securitycenter.v1.Kubernetes.Role.Kind} kind + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @instance + */ + Role.prototype.kind = 0; + + /** + * Role ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @instance + */ + Role.prototype.ns = ""; + + /** + * Role name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @instance + */ + Role.prototype.name = ""; + + /** + * Creates a new Role instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IRole=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.Role} Role instance + */ + Role.create = function create(properties) { + return new Role(properties); + }; + + /** + * Encodes the specified Role message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Role.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IRole} message Role message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Role.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ns); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified Role message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Role.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IRole} message Role message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Role.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Role message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes.Role} Role + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Role.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Kubernetes.Role(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + message.ns = reader.string(); + break; + } + case 3: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Role message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.Role} Role + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Role.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Role message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Role.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.ns != null && message.hasOwnProperty("ns")) + if (!$util.isString(message.ns)) + return "ns: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a Role message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.Role} Role + */ + Role.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.Role) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Role(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "ROLE": + case 1: + message.kind = 1; + break; + case "CLUSTER_ROLE": + case 2: + message.kind = 2; + break; + } + if (object.ns != null) + message.ns = String(object.ns); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Role message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.Role} message Role + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Role.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; + object.ns = ""; + object.name = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.cloud.securitycenter.v1.Kubernetes.Role.Kind[message.kind] === undefined ? message.kind : $root.google.cloud.securitycenter.v1.Kubernetes.Role.Kind[message.kind] : message.kind; + if (message.ns != null && message.hasOwnProperty("ns")) + object.ns = message.ns; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this Role to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @instance + * @returns {Object.} JSON object + */ + Role.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Role + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.Role + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Role.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.Role"; + }; + + /** + * Kind enum. + * @name google.cloud.securitycenter.v1.Kubernetes.Role.Kind + * @enum {number} + * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value + * @property {number} ROLE=1 ROLE value + * @property {number} CLUSTER_ROLE=2 CLUSTER_ROLE value + */ + Role.Kind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "ROLE"] = 1; + values[valuesById[2] = "CLUSTER_ROLE"] = 2; + return values; + })(); + + return Role; + })(); + + Kubernetes.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface IBinding + * @property {string|null} [ns] Binding ns + * @property {string|null} [name] Binding name + * @property {google.cloud.securitycenter.v1.Kubernetes.IRole|null} [role] Binding role + * @property {Array.|null} [subjects] Binding subjects + */ + + /** + * Constructs a new Binding. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.subjects = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + */ + Binding.prototype.ns = ""; + + /** + * Binding name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + */ + Binding.prototype.name = ""; + + /** + * Binding role. + * @member {google.cloud.securitycenter.v1.Kubernetes.IRole|null|undefined} role + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + */ + Binding.prototype.role = null; + + /** + * Binding subjects. + * @member {Array.} subjects + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + */ + Binding.prototype.subjects = $util.emptyArray; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IBinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Binding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ns); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + $root.google.cloud.securitycenter.v1.Kubernetes.Role.encode(message.role, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.subjects != null && message.subjects.length) + for (var i = 0; i < message.subjects.length; ++i) + $root.google.cloud.securitycenter.v1.Kubernetes.Subject.encode(message.subjects[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Kubernetes.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ns = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.role = $root.google.cloud.securitycenter.v1.Kubernetes.Role.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.subjects && message.subjects.length)) + message.subjects = []; + message.subjects.push($root.google.cloud.securitycenter.v1.Kubernetes.Subject.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ns != null && message.hasOwnProperty("ns")) + if (!$util.isString(message.ns)) + return "ns: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.role != null && message.hasOwnProperty("role")) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Role.verify(message.role); + if (error) + return "role." + error; + } + if (message.subjects != null && message.hasOwnProperty("subjects")) { + if (!Array.isArray(message.subjects)) + return "subjects: array expected"; + for (var i = 0; i < message.subjects.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Kubernetes.Subject.verify(message.subjects[i]); + if (error) + return "subjects." + error; + } + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.Binding) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Binding(); + if (object.ns != null) + message.ns = String(object.ns); + if (object.name != null) + message.name = String(object.name); + if (object.role != null) { + if (typeof object.role !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Binding.role: object expected"); + message.role = $root.google.cloud.securitycenter.v1.Kubernetes.Role.fromObject(object.role); + } + if (object.subjects) { + if (!Array.isArray(object.subjects)) + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Binding.subjects: array expected"); + message.subjects = []; + for (var i = 0; i < object.subjects.length; ++i) { + if (typeof object.subjects[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Kubernetes.Binding.subjects: object expected"); + message.subjects[i] = $root.google.cloud.securitycenter.v1.Kubernetes.Subject.fromObject(object.subjects[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subjects = []; + if (options.defaults) { + object.ns = ""; + object.name = ""; + object.role = null; + } + if (message.ns != null && message.hasOwnProperty("ns")) + object.ns = message.ns; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.role != null && message.hasOwnProperty("role")) + object.role = $root.google.cloud.securitycenter.v1.Kubernetes.Role.toObject(message.role, options); + if (message.subjects && message.subjects.length) { + object.subjects = []; + for (var j = 0; j < message.subjects.length; ++j) + object.subjects[j] = $root.google.cloud.securitycenter.v1.Kubernetes.Subject.toObject(message.subjects[j], options); + } + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.Binding"; + }; + + return Binding; + })(); + + Kubernetes.Subject = (function() { + + /** + * Properties of a Subject. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface ISubject + * @property {google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType|null} [kind] Subject kind + * @property {string|null} [ns] Subject ns + * @property {string|null} [name] Subject name + */ + + /** + * Constructs a new Subject. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents a Subject. + * @implements ISubject + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.ISubject=} [properties] Properties to set + */ + function Subject(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Subject kind. + * @member {google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType} kind + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @instance + */ + Subject.prototype.kind = 0; + + /** + * Subject ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @instance + */ + Subject.prototype.ns = ""; + + /** + * Subject name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @instance + */ + Subject.prototype.name = ""; + + /** + * Creates a new Subject instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.ISubject=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.Subject} Subject instance + */ + Subject.create = function create(properties) { + return new Subject(properties); + }; + + /** + * Encodes the specified Subject message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Subject.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.ISubject} message Subject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subject.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ns); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified Subject message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.Subject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.ISubject} message Subject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Subject message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes.Subject} Subject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subject.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Kubernetes.Subject(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + message.ns = reader.string(); + break; + } + case 3: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Subject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.Subject} Subject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Subject message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Subject.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.ns != null && message.hasOwnProperty("ns")) + if (!$util.isString(message.ns)) + return "ns: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a Subject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.Subject} Subject + */ + Subject.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.Subject) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.Subject(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "AUTH_TYPE_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "USER": + case 1: + message.kind = 1; + break; + case "SERVICEACCOUNT": + case 2: + message.kind = 2; + break; + case "GROUP": + case 3: + message.kind = 3; + break; + } + if (object.ns != null) + message.ns = String(object.ns); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Subject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.Subject} message Subject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Subject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = options.enums === String ? "AUTH_TYPE_UNSPECIFIED" : 0; + object.ns = ""; + object.name = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType[message.kind] === undefined ? message.kind : $root.google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType[message.kind] : message.kind; + if (message.ns != null && message.hasOwnProperty("ns")) + object.ns = message.ns; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this Subject to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @instance + * @returns {Object.} JSON object + */ + Subject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Subject + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.Subject + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Subject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.Subject"; + }; + + /** + * AuthType enum. + * @name google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType + * @enum {number} + * @property {number} AUTH_TYPE_UNSPECIFIED=0 AUTH_TYPE_UNSPECIFIED value + * @property {number} USER=1 USER value + * @property {number} SERVICEACCOUNT=2 SERVICEACCOUNT value + * @property {number} GROUP=3 GROUP value + */ + Subject.AuthType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTH_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER"] = 1; + values[valuesById[2] = "SERVICEACCOUNT"] = 2; + values[valuesById[3] = "GROUP"] = 3; + return values; + })(); + + return Subject; + })(); + + Kubernetes.AccessReview = (function() { + + /** + * Properties of an AccessReview. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @interface IAccessReview + * @property {string|null} [group] AccessReview group + * @property {string|null} [ns] AccessReview ns + * @property {string|null} [name] AccessReview name + * @property {string|null} [resource] AccessReview resource + * @property {string|null} [subresource] AccessReview subresource + * @property {string|null} [verb] AccessReview verb + * @property {string|null} [version] AccessReview version + */ + + /** + * Constructs a new AccessReview. + * @memberof google.cloud.securitycenter.v1.Kubernetes + * @classdesc Represents an AccessReview. + * @implements IAccessReview + * @constructor + * @param {google.cloud.securitycenter.v1.Kubernetes.IAccessReview=} [properties] Properties to set + */ + function AccessReview(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessReview group. + * @member {string} group + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.group = ""; + + /** + * AccessReview ns. + * @member {string} ns + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.ns = ""; + + /** + * AccessReview name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.name = ""; + + /** + * AccessReview resource. + * @member {string} resource + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.resource = ""; + + /** + * AccessReview subresource. + * @member {string} subresource + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.subresource = ""; + + /** + * AccessReview verb. + * @member {string} verb + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.verb = ""; + + /** + * AccessReview version. + * @member {string} version + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + */ + AccessReview.prototype.version = ""; + + /** + * Creates a new AccessReview instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IAccessReview=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Kubernetes.AccessReview} AccessReview instance + */ + AccessReview.create = function create(properties) { + return new AccessReview(properties); + }; + + /** + * Encodes the specified AccessReview message. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.AccessReview.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IAccessReview} message AccessReview message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessReview.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); + if (message.ns != null && Object.hasOwnProperty.call(message, "ns")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ns); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resource); + if (message.subresource != null && Object.hasOwnProperty.call(message, "subresource")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.subresource); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.verb); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.version); + return writer; + }; + + /** + * Encodes the specified AccessReview message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Kubernetes.AccessReview.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.IAccessReview} message AccessReview message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessReview.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessReview message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Kubernetes.AccessReview} AccessReview + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessReview.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Kubernetes.AccessReview(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.group = reader.string(); + break; + } + case 2: { + message.ns = reader.string(); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 4: { + message.resource = reader.string(); + break; + } + case 5: { + message.subresource = reader.string(); + break; + } + case 6: { + message.verb = reader.string(); + break; + } + case 7: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessReview message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Kubernetes.AccessReview} AccessReview + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessReview.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessReview message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessReview.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; + if (message.ns != null && message.hasOwnProperty("ns")) + if (!$util.isString(message.ns)) + return "ns: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.subresource != null && message.hasOwnProperty("subresource")) + if (!$util.isString(message.subresource)) + return "subresource: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates an AccessReview message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Kubernetes.AccessReview} AccessReview + */ + AccessReview.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Kubernetes.AccessReview) + return object; + var message = new $root.google.cloud.securitycenter.v1.Kubernetes.AccessReview(); + if (object.group != null) + message.group = String(object.group); + if (object.ns != null) + message.ns = String(object.ns); + if (object.name != null) + message.name = String(object.name); + if (object.resource != null) + message.resource = String(object.resource); + if (object.subresource != null) + message.subresource = String(object.subresource); + if (object.verb != null) + message.verb = String(object.verb); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from an AccessReview message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {google.cloud.securitycenter.v1.Kubernetes.AccessReview} message AccessReview + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessReview.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.group = ""; + object.ns = ""; + object.name = ""; + object.resource = ""; + object.subresource = ""; + object.verb = ""; + object.version = ""; + } + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.ns != null && message.hasOwnProperty("ns")) + object.ns = message.ns; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.subresource != null && message.hasOwnProperty("subresource")) + object.subresource = message.subresource; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this AccessReview to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @instance + * @returns {Object.} JSON object + */ + AccessReview.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessReview + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Kubernetes.AccessReview + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessReview.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Kubernetes.AccessReview"; + }; + + return AccessReview; + })(); + + return Kubernetes; + })(); + + v1.MitreAttack = (function() { + + /** + * Properties of a MitreAttack. + * @memberof google.cloud.securitycenter.v1 + * @interface IMitreAttack + * @property {google.cloud.securitycenter.v1.MitreAttack.Tactic|null} [primaryTactic] MitreAttack primaryTactic + * @property {Array.|null} [primaryTechniques] MitreAttack primaryTechniques + * @property {Array.|null} [additionalTactics] MitreAttack additionalTactics + * @property {Array.|null} [additionalTechniques] MitreAttack additionalTechniques + * @property {string|null} [version] MitreAttack version + */ + + /** + * Constructs a new MitreAttack. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a MitreAttack. + * @implements IMitreAttack + * @constructor + * @param {google.cloud.securitycenter.v1.IMitreAttack=} [properties] Properties to set + */ + function MitreAttack(properties) { + this.primaryTechniques = []; + this.additionalTactics = []; + this.additionalTechniques = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MitreAttack primaryTactic. + * @member {google.cloud.securitycenter.v1.MitreAttack.Tactic} primaryTactic + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.primaryTactic = 0; + + /** + * MitreAttack primaryTechniques. + * @member {Array.} primaryTechniques + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.primaryTechniques = $util.emptyArray; + + /** + * MitreAttack additionalTactics. + * @member {Array.} additionalTactics + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.additionalTactics = $util.emptyArray; + + /** + * MitreAttack additionalTechniques. + * @member {Array.} additionalTechniques + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.additionalTechniques = $util.emptyArray; + + /** + * MitreAttack version. + * @member {string} version + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + */ + MitreAttack.prototype.version = ""; + + /** + * Creates a new MitreAttack instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {google.cloud.securitycenter.v1.IMitreAttack=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack instance + */ + MitreAttack.create = function create(properties) { + return new MitreAttack(properties); + }; + + /** + * Encodes the specified MitreAttack message. Does not implicitly {@link google.cloud.securitycenter.v1.MitreAttack.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {google.cloud.securitycenter.v1.IMitreAttack} message MitreAttack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MitreAttack.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryTactic != null && Object.hasOwnProperty.call(message, "primaryTactic")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.primaryTactic); + if (message.primaryTechniques != null && message.primaryTechniques.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.primaryTechniques.length; ++i) + writer.int32(message.primaryTechniques[i]); + writer.ldelim(); + } + if (message.additionalTactics != null && message.additionalTactics.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.additionalTactics.length; ++i) + writer.int32(message.additionalTactics[i]); + writer.ldelim(); + } + if (message.additionalTechniques != null && message.additionalTechniques.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.additionalTechniques.length; ++i) + writer.int32(message.additionalTechniques[i]); + writer.ldelim(); + } + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); + return writer; + }; + + /** + * Encodes the specified MitreAttack message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.MitreAttack.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {google.cloud.securitycenter.v1.IMitreAttack} message MitreAttack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MitreAttack.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MitreAttack message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MitreAttack.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.MitreAttack(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.primaryTactic = reader.int32(); + break; + } + case 2: { + if (!(message.primaryTechniques && message.primaryTechniques.length)) + message.primaryTechniques = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.primaryTechniques.push(reader.int32()); + } else + message.primaryTechniques.push(reader.int32()); + break; + } + case 3: { + if (!(message.additionalTactics && message.additionalTactics.length)) + message.additionalTactics = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.additionalTactics.push(reader.int32()); + } else + message.additionalTactics.push(reader.int32()); + break; + } + case 4: { + if (!(message.additionalTechniques && message.additionalTechniques.length)) + message.additionalTechniques = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.additionalTechniques.push(reader.int32()); + } else + message.additionalTechniques.push(reader.int32()); + break; + } + case 5: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MitreAttack message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MitreAttack.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MitreAttack message. + * @function verify + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MitreAttack.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryTactic != null && message.hasOwnProperty("primaryTactic")) + switch (message.primaryTactic) { + default: + return "primaryTactic: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 6: + case 8: + case 7: + case 9: + case 10: + case 11: + case 12: + case 4: + case 13: + case 14: + break; + } + if (message.primaryTechniques != null && message.hasOwnProperty("primaryTechniques")) { + if (!Array.isArray(message.primaryTechniques)) + return "primaryTechniques: array expected"; + for (var i = 0; i < message.primaryTechniques.length; ++i) + switch (message.primaryTechniques[i]) { + default: + return "primaryTechniques: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + break; + } + } + if (message.additionalTactics != null && message.hasOwnProperty("additionalTactics")) { + if (!Array.isArray(message.additionalTactics)) + return "additionalTactics: array expected"; + for (var i = 0; i < message.additionalTactics.length; ++i) + switch (message.additionalTactics[i]) { + default: + return "additionalTactics: enum value[] expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 6: + case 8: + case 7: + case 9: + case 10: + case 11: + case 12: + case 4: + case 13: + case 14: + break; + } + } + if (message.additionalTechniques != null && message.hasOwnProperty("additionalTechniques")) { + if (!Array.isArray(message.additionalTechniques)) + return "additionalTechniques: array expected"; + for (var i = 0; i < message.additionalTechniques.length; ++i) + switch (message.additionalTechniques[i]) { + default: + return "additionalTechniques: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + break; + } + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a MitreAttack message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.MitreAttack} MitreAttack + */ + MitreAttack.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.MitreAttack) + return object; + var message = new $root.google.cloud.securitycenter.v1.MitreAttack(); + switch (object.primaryTactic) { + default: + if (typeof object.primaryTactic === "number") { + message.primaryTactic = object.primaryTactic; + break; + } + break; + case "TACTIC_UNSPECIFIED": + case 0: + message.primaryTactic = 0; + break; + case "RECONNAISSANCE": + case 1: + message.primaryTactic = 1; + break; + case "RESOURCE_DEVELOPMENT": + case 2: + message.primaryTactic = 2; + break; + case "INITIAL_ACCESS": + case 5: + message.primaryTactic = 5; + break; + case "EXECUTION": + case 3: + message.primaryTactic = 3; + break; + case "PERSISTENCE": + case 6: + message.primaryTactic = 6; + break; + case "PRIVILEGE_ESCALATION": + case 8: + message.primaryTactic = 8; + break; + case "DEFENSE_EVASION": + case 7: + message.primaryTactic = 7; + break; + case "CREDENTIAL_ACCESS": + case 9: + message.primaryTactic = 9; + break; + case "DISCOVERY": + case 10: + message.primaryTactic = 10; + break; + case "LATERAL_MOVEMENT": + case 11: + message.primaryTactic = 11; + break; + case "COLLECTION": + case 12: + message.primaryTactic = 12; + break; + case "COMMAND_AND_CONTROL": + case 4: + message.primaryTactic = 4; + break; + case "EXFILTRATION": + case 13: + message.primaryTactic = 13; + break; + case "IMPACT": + case 14: + message.primaryTactic = 14; + break; + } + if (object.primaryTechniques) { + if (!Array.isArray(object.primaryTechniques)) + throw TypeError(".google.cloud.securitycenter.v1.MitreAttack.primaryTechniques: array expected"); + message.primaryTechniques = []; + for (var i = 0; i < object.primaryTechniques.length; ++i) + switch (object.primaryTechniques[i]) { + default: + if (typeof object.primaryTechniques[i] === "number") { + message.primaryTechniques[i] = object.primaryTechniques[i]; + break; + } + case "TECHNIQUE_UNSPECIFIED": + case 0: + message.primaryTechniques[i] = 0; + break; + case "ACTIVE_SCANNING": + case 1: + message.primaryTechniques[i] = 1; + break; + case "SCANNING_IP_BLOCKS": + case 2: + message.primaryTechniques[i] = 2; + break; + case "INGRESS_TOOL_TRANSFER": + case 3: + message.primaryTechniques[i] = 3; + break; + case "NATIVE_API": + case 4: + message.primaryTechniques[i] = 4; + break; + case "SHARED_MODULES": + case 5: + message.primaryTechniques[i] = 5; + break; + case "COMMAND_AND_SCRIPTING_INTERPRETER": + case 6: + message.primaryTechniques[i] = 6; + break; + case "UNIX_SHELL": + case 7: + message.primaryTechniques[i] = 7; + break; + case "RESOURCE_HIJACKING": + case 8: + message.primaryTechniques[i] = 8; + break; + case "PROXY": + case 9: + message.primaryTechniques[i] = 9; + break; + case "EXTERNAL_PROXY": + case 10: + message.primaryTechniques[i] = 10; + break; + case "MULTI_HOP_PROXY": + case 11: + message.primaryTechniques[i] = 11; + break; + case "DYNAMIC_RESOLUTION": + case 12: + message.primaryTechniques[i] = 12; + break; + case "UNSECURED_CREDENTIALS": + case 13: + message.primaryTechniques[i] = 13; + break; + case "VALID_ACCOUNTS": + case 14: + message.primaryTechniques[i] = 14; + break; + case "LOCAL_ACCOUNTS": + case 15: + message.primaryTechniques[i] = 15; + break; + case "CLOUD_ACCOUNTS": + case 16: + message.primaryTechniques[i] = 16; + break; + case "NETWORK_DENIAL_OF_SERVICE": + case 17: + message.primaryTechniques[i] = 17; + break; + case "PERMISSION_GROUPS_DISCOVERY": + case 18: + message.primaryTechniques[i] = 18; + break; + case "CLOUD_GROUPS": + case 19: + message.primaryTechniques[i] = 19; + break; + case "EXFILTRATION_OVER_WEB_SERVICE": + case 20: + message.primaryTechniques[i] = 20; + break; + case "EXFILTRATION_TO_CLOUD_STORAGE": + case 21: + message.primaryTechniques[i] = 21; + break; + case "ACCOUNT_MANIPULATION": + case 22: + message.primaryTechniques[i] = 22; + break; + case "SSH_AUTHORIZED_KEYS": + case 23: + message.primaryTechniques[i] = 23; + break; + case "CREATE_OR_MODIFY_SYSTEM_PROCESS": + case 24: + message.primaryTechniques[i] = 24; + break; + case "STEAL_WEB_SESSION_COOKIE": + case 25: + message.primaryTechniques[i] = 25; + break; + case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": + case 26: + message.primaryTechniques[i] = 26; + break; + case "EXPLOIT_PUBLIC_FACING_APPLICATION": + case 27: + message.primaryTechniques[i] = 27; + break; + case "MODIFY_AUTHENTICATION_PROCESS": + case 28: + message.primaryTechniques[i] = 28; + break; + case "DATA_DESTRUCTION": + case 29: + message.primaryTechniques[i] = 29; + break; + case "DOMAIN_POLICY_MODIFICATION": + case 30: + message.primaryTechniques[i] = 30; + break; + case "IMPAIR_DEFENSES": + case 31: + message.primaryTechniques[i] = 31; + break; + case "NETWORK_SERVICE_DISCOVERY": + case 32: + message.primaryTechniques[i] = 32; + break; + case "ACCESS_TOKEN_MANIPULATION": + case 33: + message.primaryTechniques[i] = 33; + break; + case "ABUSE_ELEVATION_CONTROL_MECHANISM": + case 34: + message.primaryTechniques[i] = 34; + break; + case "DEFAULT_ACCOUNTS": + case 35: + message.primaryTechniques[i] = 35; + break; + } + } + if (object.additionalTactics) { + if (!Array.isArray(object.additionalTactics)) + throw TypeError(".google.cloud.securitycenter.v1.MitreAttack.additionalTactics: array expected"); + message.additionalTactics = []; + for (var i = 0; i < object.additionalTactics.length; ++i) + switch (object.additionalTactics[i]) { + default: + if (typeof object.additionalTactics[i] === "number") { + message.additionalTactics[i] = object.additionalTactics[i]; + break; + } + case "TACTIC_UNSPECIFIED": + case 0: + message.additionalTactics[i] = 0; + break; + case "RECONNAISSANCE": + case 1: + message.additionalTactics[i] = 1; + break; + case "RESOURCE_DEVELOPMENT": + case 2: + message.additionalTactics[i] = 2; + break; + case "INITIAL_ACCESS": + case 5: + message.additionalTactics[i] = 5; + break; + case "EXECUTION": + case 3: + message.additionalTactics[i] = 3; + break; + case "PERSISTENCE": + case 6: + message.additionalTactics[i] = 6; + break; + case "PRIVILEGE_ESCALATION": + case 8: + message.additionalTactics[i] = 8; + break; + case "DEFENSE_EVASION": + case 7: + message.additionalTactics[i] = 7; + break; + case "CREDENTIAL_ACCESS": + case 9: + message.additionalTactics[i] = 9; + break; + case "DISCOVERY": + case 10: + message.additionalTactics[i] = 10; + break; + case "LATERAL_MOVEMENT": + case 11: + message.additionalTactics[i] = 11; + break; + case "COLLECTION": + case 12: + message.additionalTactics[i] = 12; + break; + case "COMMAND_AND_CONTROL": + case 4: + message.additionalTactics[i] = 4; + break; + case "EXFILTRATION": + case 13: + message.additionalTactics[i] = 13; + break; + case "IMPACT": + case 14: + message.additionalTactics[i] = 14; + break; + } + } + if (object.additionalTechniques) { + if (!Array.isArray(object.additionalTechniques)) + throw TypeError(".google.cloud.securitycenter.v1.MitreAttack.additionalTechniques: array expected"); + message.additionalTechniques = []; + for (var i = 0; i < object.additionalTechniques.length; ++i) + switch (object.additionalTechniques[i]) { + default: + if (typeof object.additionalTechniques[i] === "number") { + message.additionalTechniques[i] = object.additionalTechniques[i]; + break; + } + case "TECHNIQUE_UNSPECIFIED": + case 0: + message.additionalTechniques[i] = 0; + break; + case "ACTIVE_SCANNING": + case 1: + message.additionalTechniques[i] = 1; + break; + case "SCANNING_IP_BLOCKS": + case 2: + message.additionalTechniques[i] = 2; + break; + case "INGRESS_TOOL_TRANSFER": + case 3: + message.additionalTechniques[i] = 3; + break; + case "NATIVE_API": + case 4: + message.additionalTechniques[i] = 4; + break; + case "SHARED_MODULES": + case 5: + message.additionalTechniques[i] = 5; + break; + case "COMMAND_AND_SCRIPTING_INTERPRETER": + case 6: + message.additionalTechniques[i] = 6; + break; + case "UNIX_SHELL": + case 7: + message.additionalTechniques[i] = 7; + break; + case "RESOURCE_HIJACKING": + case 8: + message.additionalTechniques[i] = 8; + break; + case "PROXY": + case 9: + message.additionalTechniques[i] = 9; + break; + case "EXTERNAL_PROXY": + case 10: + message.additionalTechniques[i] = 10; + break; + case "MULTI_HOP_PROXY": + case 11: + message.additionalTechniques[i] = 11; + break; + case "DYNAMIC_RESOLUTION": + case 12: + message.additionalTechniques[i] = 12; + break; + case "UNSECURED_CREDENTIALS": + case 13: + message.additionalTechniques[i] = 13; + break; + case "VALID_ACCOUNTS": + case 14: + message.additionalTechniques[i] = 14; + break; + case "LOCAL_ACCOUNTS": + case 15: + message.additionalTechniques[i] = 15; + break; + case "CLOUD_ACCOUNTS": + case 16: + message.additionalTechniques[i] = 16; + break; + case "NETWORK_DENIAL_OF_SERVICE": + case 17: + message.additionalTechniques[i] = 17; + break; + case "PERMISSION_GROUPS_DISCOVERY": + case 18: + message.additionalTechniques[i] = 18; + break; + case "CLOUD_GROUPS": + case 19: + message.additionalTechniques[i] = 19; + break; + case "EXFILTRATION_OVER_WEB_SERVICE": + case 20: + message.additionalTechniques[i] = 20; + break; + case "EXFILTRATION_TO_CLOUD_STORAGE": + case 21: + message.additionalTechniques[i] = 21; + break; + case "ACCOUNT_MANIPULATION": + case 22: + message.additionalTechniques[i] = 22; + break; + case "SSH_AUTHORIZED_KEYS": + case 23: + message.additionalTechniques[i] = 23; + break; + case "CREATE_OR_MODIFY_SYSTEM_PROCESS": + case 24: + message.additionalTechniques[i] = 24; + break; + case "STEAL_WEB_SESSION_COOKIE": + case 25: + message.additionalTechniques[i] = 25; + break; + case "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": + case 26: + message.additionalTechniques[i] = 26; + break; + case "EXPLOIT_PUBLIC_FACING_APPLICATION": + case 27: + message.additionalTechniques[i] = 27; + break; + case "MODIFY_AUTHENTICATION_PROCESS": + case 28: + message.additionalTechniques[i] = 28; + break; + case "DATA_DESTRUCTION": + case 29: + message.additionalTechniques[i] = 29; + break; + case "DOMAIN_POLICY_MODIFICATION": + case 30: + message.additionalTechniques[i] = 30; + break; + case "IMPAIR_DEFENSES": + case 31: + message.additionalTechniques[i] = 31; + break; + case "NETWORK_SERVICE_DISCOVERY": + case 32: + message.additionalTechniques[i] = 32; + break; + case "ACCESS_TOKEN_MANIPULATION": + case 33: + message.additionalTechniques[i] = 33; + break; + case "ABUSE_ELEVATION_CONTROL_MECHANISM": + case 34: + message.additionalTechniques[i] = 34; + break; + case "DEFAULT_ACCOUNTS": + case 35: + message.additionalTechniques[i] = 35; + break; + } + } + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a MitreAttack message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {google.cloud.securitycenter.v1.MitreAttack} message MitreAttack + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MitreAttack.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.primaryTechniques = []; + object.additionalTactics = []; + object.additionalTechniques = []; + } + if (options.defaults) { + object.primaryTactic = options.enums === String ? "TACTIC_UNSPECIFIED" : 0; + object.version = ""; + } + if (message.primaryTactic != null && message.hasOwnProperty("primaryTactic")) + object.primaryTactic = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.primaryTactic] === undefined ? message.primaryTactic : $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.primaryTactic] : message.primaryTactic; + if (message.primaryTechniques && message.primaryTechniques.length) { + object.primaryTechniques = []; + for (var j = 0; j < message.primaryTechniques.length; ++j) + object.primaryTechniques[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.primaryTechniques[j]] === undefined ? message.primaryTechniques[j] : $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.primaryTechniques[j]] : message.primaryTechniques[j]; + } + if (message.additionalTactics && message.additionalTactics.length) { + object.additionalTactics = []; + for (var j = 0; j < message.additionalTactics.length; ++j) + object.additionalTactics[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.additionalTactics[j]] === undefined ? message.additionalTactics[j] : $root.google.cloud.securitycenter.v1.MitreAttack.Tactic[message.additionalTactics[j]] : message.additionalTactics[j]; + } + if (message.additionalTechniques && message.additionalTechniques.length) { + object.additionalTechniques = []; + for (var j = 0; j < message.additionalTechniques.length; ++j) + object.additionalTechniques[j] = options.enums === String ? $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.additionalTechniques[j]] === undefined ? message.additionalTechniques[j] : $root.google.cloud.securitycenter.v1.MitreAttack.Technique[message.additionalTechniques[j]] : message.additionalTechniques[j]; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this MitreAttack to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @instance + * @returns {Object.} JSON object + */ + MitreAttack.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MitreAttack + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.MitreAttack + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MitreAttack.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.MitreAttack"; + }; + + /** + * Tactic enum. + * @name google.cloud.securitycenter.v1.MitreAttack.Tactic + * @enum {number} + * @property {number} TACTIC_UNSPECIFIED=0 TACTIC_UNSPECIFIED value + * @property {number} RECONNAISSANCE=1 RECONNAISSANCE value + * @property {number} RESOURCE_DEVELOPMENT=2 RESOURCE_DEVELOPMENT value + * @property {number} INITIAL_ACCESS=5 INITIAL_ACCESS value + * @property {number} EXECUTION=3 EXECUTION value + * @property {number} PERSISTENCE=6 PERSISTENCE value + * @property {number} PRIVILEGE_ESCALATION=8 PRIVILEGE_ESCALATION value + * @property {number} DEFENSE_EVASION=7 DEFENSE_EVASION value + * @property {number} CREDENTIAL_ACCESS=9 CREDENTIAL_ACCESS value + * @property {number} DISCOVERY=10 DISCOVERY value + * @property {number} LATERAL_MOVEMENT=11 LATERAL_MOVEMENT value + * @property {number} COLLECTION=12 COLLECTION value + * @property {number} COMMAND_AND_CONTROL=4 COMMAND_AND_CONTROL value + * @property {number} EXFILTRATION=13 EXFILTRATION value + * @property {number} IMPACT=14 IMPACT value + */ + MitreAttack.Tactic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TACTIC_UNSPECIFIED"] = 0; + values[valuesById[1] = "RECONNAISSANCE"] = 1; + values[valuesById[2] = "RESOURCE_DEVELOPMENT"] = 2; + values[valuesById[5] = "INITIAL_ACCESS"] = 5; + values[valuesById[3] = "EXECUTION"] = 3; + values[valuesById[6] = "PERSISTENCE"] = 6; + values[valuesById[8] = "PRIVILEGE_ESCALATION"] = 8; + values[valuesById[7] = "DEFENSE_EVASION"] = 7; + values[valuesById[9] = "CREDENTIAL_ACCESS"] = 9; + values[valuesById[10] = "DISCOVERY"] = 10; + values[valuesById[11] = "LATERAL_MOVEMENT"] = 11; + values[valuesById[12] = "COLLECTION"] = 12; + values[valuesById[4] = "COMMAND_AND_CONTROL"] = 4; + values[valuesById[13] = "EXFILTRATION"] = 13; + values[valuesById[14] = "IMPACT"] = 14; + return values; + })(); + + /** + * Technique enum. + * @name google.cloud.securitycenter.v1.MitreAttack.Technique + * @enum {number} + * @property {number} TECHNIQUE_UNSPECIFIED=0 TECHNIQUE_UNSPECIFIED value + * @property {number} ACTIVE_SCANNING=1 ACTIVE_SCANNING value + * @property {number} SCANNING_IP_BLOCKS=2 SCANNING_IP_BLOCKS value + * @property {number} INGRESS_TOOL_TRANSFER=3 INGRESS_TOOL_TRANSFER value + * @property {number} NATIVE_API=4 NATIVE_API value + * @property {number} SHARED_MODULES=5 SHARED_MODULES value + * @property {number} COMMAND_AND_SCRIPTING_INTERPRETER=6 COMMAND_AND_SCRIPTING_INTERPRETER value + * @property {number} UNIX_SHELL=7 UNIX_SHELL value + * @property {number} RESOURCE_HIJACKING=8 RESOURCE_HIJACKING value + * @property {number} PROXY=9 PROXY value + * @property {number} EXTERNAL_PROXY=10 EXTERNAL_PROXY value + * @property {number} MULTI_HOP_PROXY=11 MULTI_HOP_PROXY value + * @property {number} DYNAMIC_RESOLUTION=12 DYNAMIC_RESOLUTION value + * @property {number} UNSECURED_CREDENTIALS=13 UNSECURED_CREDENTIALS value + * @property {number} VALID_ACCOUNTS=14 VALID_ACCOUNTS value + * @property {number} LOCAL_ACCOUNTS=15 LOCAL_ACCOUNTS value + * @property {number} CLOUD_ACCOUNTS=16 CLOUD_ACCOUNTS value + * @property {number} NETWORK_DENIAL_OF_SERVICE=17 NETWORK_DENIAL_OF_SERVICE value + * @property {number} PERMISSION_GROUPS_DISCOVERY=18 PERMISSION_GROUPS_DISCOVERY value + * @property {number} CLOUD_GROUPS=19 CLOUD_GROUPS value + * @property {number} EXFILTRATION_OVER_WEB_SERVICE=20 EXFILTRATION_OVER_WEB_SERVICE value + * @property {number} EXFILTRATION_TO_CLOUD_STORAGE=21 EXFILTRATION_TO_CLOUD_STORAGE value + * @property {number} ACCOUNT_MANIPULATION=22 ACCOUNT_MANIPULATION value + * @property {number} SSH_AUTHORIZED_KEYS=23 SSH_AUTHORIZED_KEYS value + * @property {number} CREATE_OR_MODIFY_SYSTEM_PROCESS=24 CREATE_OR_MODIFY_SYSTEM_PROCESS value + * @property {number} STEAL_WEB_SESSION_COOKIE=25 STEAL_WEB_SESSION_COOKIE value + * @property {number} MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE=26 MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE value + * @property {number} EXPLOIT_PUBLIC_FACING_APPLICATION=27 EXPLOIT_PUBLIC_FACING_APPLICATION value + * @property {number} MODIFY_AUTHENTICATION_PROCESS=28 MODIFY_AUTHENTICATION_PROCESS value + * @property {number} DATA_DESTRUCTION=29 DATA_DESTRUCTION value + * @property {number} DOMAIN_POLICY_MODIFICATION=30 DOMAIN_POLICY_MODIFICATION value + * @property {number} IMPAIR_DEFENSES=31 IMPAIR_DEFENSES value + * @property {number} NETWORK_SERVICE_DISCOVERY=32 NETWORK_SERVICE_DISCOVERY value + * @property {number} ACCESS_TOKEN_MANIPULATION=33 ACCESS_TOKEN_MANIPULATION value + * @property {number} ABUSE_ELEVATION_CONTROL_MECHANISM=34 ABUSE_ELEVATION_CONTROL_MECHANISM value + * @property {number} DEFAULT_ACCOUNTS=35 DEFAULT_ACCOUNTS value + */ + MitreAttack.Technique = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TECHNIQUE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE_SCANNING"] = 1; + values[valuesById[2] = "SCANNING_IP_BLOCKS"] = 2; + values[valuesById[3] = "INGRESS_TOOL_TRANSFER"] = 3; + values[valuesById[4] = "NATIVE_API"] = 4; + values[valuesById[5] = "SHARED_MODULES"] = 5; + values[valuesById[6] = "COMMAND_AND_SCRIPTING_INTERPRETER"] = 6; + values[valuesById[7] = "UNIX_SHELL"] = 7; + values[valuesById[8] = "RESOURCE_HIJACKING"] = 8; + values[valuesById[9] = "PROXY"] = 9; + values[valuesById[10] = "EXTERNAL_PROXY"] = 10; + values[valuesById[11] = "MULTI_HOP_PROXY"] = 11; + values[valuesById[12] = "DYNAMIC_RESOLUTION"] = 12; + values[valuesById[13] = "UNSECURED_CREDENTIALS"] = 13; + values[valuesById[14] = "VALID_ACCOUNTS"] = 14; + values[valuesById[15] = "LOCAL_ACCOUNTS"] = 15; + values[valuesById[16] = "CLOUD_ACCOUNTS"] = 16; + values[valuesById[17] = "NETWORK_DENIAL_OF_SERVICE"] = 17; + values[valuesById[18] = "PERMISSION_GROUPS_DISCOVERY"] = 18; + values[valuesById[19] = "CLOUD_GROUPS"] = 19; + values[valuesById[20] = "EXFILTRATION_OVER_WEB_SERVICE"] = 20; + values[valuesById[21] = "EXFILTRATION_TO_CLOUD_STORAGE"] = 21; + values[valuesById[22] = "ACCOUNT_MANIPULATION"] = 22; + values[valuesById[23] = "SSH_AUTHORIZED_KEYS"] = 23; + values[valuesById[24] = "CREATE_OR_MODIFY_SYSTEM_PROCESS"] = 24; + values[valuesById[25] = "STEAL_WEB_SESSION_COOKIE"] = 25; + values[valuesById[26] = "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE"] = 26; + values[valuesById[27] = "EXPLOIT_PUBLIC_FACING_APPLICATION"] = 27; + values[valuesById[28] = "MODIFY_AUTHENTICATION_PROCESS"] = 28; + values[valuesById[29] = "DATA_DESTRUCTION"] = 29; + values[valuesById[30] = "DOMAIN_POLICY_MODIFICATION"] = 30; + values[valuesById[31] = "IMPAIR_DEFENSES"] = 31; + values[valuesById[32] = "NETWORK_SERVICE_DISCOVERY"] = 32; + values[valuesById[33] = "ACCESS_TOKEN_MANIPULATION"] = 33; + values[valuesById[34] = "ABUSE_ELEVATION_CONTROL_MECHANISM"] = 34; + values[valuesById[35] = "DEFAULT_ACCOUNTS"] = 35; + return values; + })(); + + return MitreAttack; + })(); + + v1.Process = (function() { + + /** + * Properties of a Process. + * @memberof google.cloud.securitycenter.v1 + * @interface IProcess + * @property {string|null} [name] Process name + * @property {google.cloud.securitycenter.v1.IFile|null} [binary] Process binary + * @property {Array.|null} [libraries] Process libraries + * @property {google.cloud.securitycenter.v1.IFile|null} [script] Process script + * @property {Array.|null} [args] Process args + * @property {boolean|null} [argumentsTruncated] Process argumentsTruncated + * @property {Array.|null} [envVariables] Process envVariables + * @property {boolean|null} [envVariablesTruncated] Process envVariablesTruncated + * @property {number|Long|null} [pid] Process pid + * @property {number|Long|null} [parentPid] Process parentPid + */ + + /** + * Constructs a new Process. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Process. + * @implements IProcess + * @constructor + * @param {google.cloud.securitycenter.v1.IProcess=} [properties] Properties to set + */ + function Process(properties) { + this.libraries = []; + this.args = []; + this.envVariables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Process name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.name = ""; + + /** + * Process binary. + * @member {google.cloud.securitycenter.v1.IFile|null|undefined} binary + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.binary = null; + + /** + * Process libraries. + * @member {Array.} libraries + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.libraries = $util.emptyArray; + + /** + * Process script. + * @member {google.cloud.securitycenter.v1.IFile|null|undefined} script + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.script = null; + + /** + * Process args. + * @member {Array.} args + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.args = $util.emptyArray; + + /** + * Process argumentsTruncated. + * @member {boolean} argumentsTruncated + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.argumentsTruncated = false; + + /** + * Process envVariables. + * @member {Array.} envVariables + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.envVariables = $util.emptyArray; + + /** + * Process envVariablesTruncated. + * @member {boolean} envVariablesTruncated + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.envVariablesTruncated = false; + + /** + * Process pid. + * @member {number|Long} pid + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.pid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Process parentPid. + * @member {number|Long} parentPid + * @memberof google.cloud.securitycenter.v1.Process + * @instance + */ + Process.prototype.parentPid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Process instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {google.cloud.securitycenter.v1.IProcess=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Process} Process instance + */ + Process.create = function create(properties) { + return new Process(properties); + }; + + /** + * Encodes the specified Process message. Does not implicitly {@link google.cloud.securitycenter.v1.Process.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {google.cloud.securitycenter.v1.IProcess} message Process message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Process.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.binary != null && Object.hasOwnProperty.call(message, "binary")) + $root.google.cloud.securitycenter.v1.File.encode(message.binary, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.libraries != null && message.libraries.length) + for (var i = 0; i < message.libraries.length; ++i) + $root.google.cloud.securitycenter.v1.File.encode(message.libraries[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.script != null && Object.hasOwnProperty.call(message, "script")) + $root.google.cloud.securitycenter.v1.File.encode(message.script, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.args[i]); + if (message.argumentsTruncated != null && Object.hasOwnProperty.call(message, "argumentsTruncated")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.argumentsTruncated); + if (message.envVariables != null && message.envVariables.length) + for (var i = 0; i < message.envVariables.length; ++i) + $root.google.cloud.securitycenter.v1.EnvironmentVariable.encode(message.envVariables[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.envVariablesTruncated != null && Object.hasOwnProperty.call(message, "envVariablesTruncated")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.envVariablesTruncated); + if (message.pid != null && Object.hasOwnProperty.call(message, "pid")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.pid); + if (message.parentPid != null && Object.hasOwnProperty.call(message, "parentPid")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.parentPid); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.name); + return writer; + }; + + /** + * Encodes the specified Process message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Process.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {google.cloud.securitycenter.v1.IProcess} message Process message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Process.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Process message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Process} Process + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Process.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Process(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 12: { + message.name = reader.string(); + break; + } + case 3: { + message.binary = $root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.libraries && message.libraries.length)) + message.libraries = []; + message.libraries.push($root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32())); + break; + } + case 5: { + message.script = $root.google.cloud.securitycenter.v1.File.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 7: { + message.argumentsTruncated = reader.bool(); + break; + } + case 8: { + if (!(message.envVariables && message.envVariables.length)) + message.envVariables = []; + message.envVariables.push($root.google.cloud.securitycenter.v1.EnvironmentVariable.decode(reader, reader.uint32())); + break; + } + case 9: { + message.envVariablesTruncated = reader.bool(); + break; + } + case 10: { + message.pid = reader.int64(); + break; + } + case 11: { + message.parentPid = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Process message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Process} Process + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Process.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Process message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Process.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.binary != null && message.hasOwnProperty("binary")) { + var error = $root.google.cloud.securitycenter.v1.File.verify(message.binary); + if (error) + return "binary." + error; + } + if (message.libraries != null && message.hasOwnProperty("libraries")) { + if (!Array.isArray(message.libraries)) + return "libraries: array expected"; + for (var i = 0; i < message.libraries.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.File.verify(message.libraries[i]); + if (error) + return "libraries." + error; + } + } + if (message.script != null && message.hasOwnProperty("script")) { + var error = $root.google.cloud.securitycenter.v1.File.verify(message.script); + if (error) + return "script." + error; + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) + if (!$util.isString(message.args[i])) + return "args: string[] expected"; + } + if (message.argumentsTruncated != null && message.hasOwnProperty("argumentsTruncated")) + if (typeof message.argumentsTruncated !== "boolean") + return "argumentsTruncated: boolean expected"; + if (message.envVariables != null && message.hasOwnProperty("envVariables")) { + if (!Array.isArray(message.envVariables)) + return "envVariables: array expected"; + for (var i = 0; i < message.envVariables.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.EnvironmentVariable.verify(message.envVariables[i]); + if (error) + return "envVariables." + error; + } + } + if (message.envVariablesTruncated != null && message.hasOwnProperty("envVariablesTruncated")) + if (typeof message.envVariablesTruncated !== "boolean") + return "envVariablesTruncated: boolean expected"; + if (message.pid != null && message.hasOwnProperty("pid")) + if (!$util.isInteger(message.pid) && !(message.pid && $util.isInteger(message.pid.low) && $util.isInteger(message.pid.high))) + return "pid: integer|Long expected"; + if (message.parentPid != null && message.hasOwnProperty("parentPid")) + if (!$util.isInteger(message.parentPid) && !(message.parentPid && $util.isInteger(message.parentPid.low) && $util.isInteger(message.parentPid.high))) + return "parentPid: integer|Long expected"; + return null; + }; + + /** + * Creates a Process message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Process} Process + */ + Process.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Process) + return object; + var message = new $root.google.cloud.securitycenter.v1.Process(); + if (object.name != null) + message.name = String(object.name); + if (object.binary != null) { + if (typeof object.binary !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Process.binary: object expected"); + message.binary = $root.google.cloud.securitycenter.v1.File.fromObject(object.binary); + } + if (object.libraries) { + if (!Array.isArray(object.libraries)) + throw TypeError(".google.cloud.securitycenter.v1.Process.libraries: array expected"); + message.libraries = []; + for (var i = 0; i < object.libraries.length; ++i) { + if (typeof object.libraries[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Process.libraries: object expected"); + message.libraries[i] = $root.google.cloud.securitycenter.v1.File.fromObject(object.libraries[i]); + } + } + if (object.script != null) { + if (typeof object.script !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Process.script: object expected"); + message.script = $root.google.cloud.securitycenter.v1.File.fromObject(object.script); + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.securitycenter.v1.Process.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.argumentsTruncated != null) + message.argumentsTruncated = Boolean(object.argumentsTruncated); + if (object.envVariables) { + if (!Array.isArray(object.envVariables)) + throw TypeError(".google.cloud.securitycenter.v1.Process.envVariables: array expected"); + message.envVariables = []; + for (var i = 0; i < object.envVariables.length; ++i) { + if (typeof object.envVariables[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Process.envVariables: object expected"); + message.envVariables[i] = $root.google.cloud.securitycenter.v1.EnvironmentVariable.fromObject(object.envVariables[i]); + } + } + if (object.envVariablesTruncated != null) + message.envVariablesTruncated = Boolean(object.envVariablesTruncated); + if (object.pid != null) + if ($util.Long) + (message.pid = $util.Long.fromValue(object.pid)).unsigned = false; + else if (typeof object.pid === "string") + message.pid = parseInt(object.pid, 10); + else if (typeof object.pid === "number") + message.pid = object.pid; + else if (typeof object.pid === "object") + message.pid = new $util.LongBits(object.pid.low >>> 0, object.pid.high >>> 0).toNumber(); + if (object.parentPid != null) + if ($util.Long) + (message.parentPid = $util.Long.fromValue(object.parentPid)).unsigned = false; + else if (typeof object.parentPid === "string") + message.parentPid = parseInt(object.parentPid, 10); + else if (typeof object.parentPid === "number") + message.parentPid = object.parentPid; + else if (typeof object.parentPid === "object") + message.parentPid = new $util.LongBits(object.parentPid.low >>> 0, object.parentPid.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Process message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {google.cloud.securitycenter.v1.Process} message Process + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Process.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.libraries = []; + object.args = []; + object.envVariables = []; + } + if (options.defaults) { + object.binary = null; + object.script = null; + object.argumentsTruncated = false; + object.envVariablesTruncated = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.pid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.pid = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.parentPid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.parentPid = options.longs === String ? "0" : 0; + object.name = ""; + } + if (message.binary != null && message.hasOwnProperty("binary")) + object.binary = $root.google.cloud.securitycenter.v1.File.toObject(message.binary, options); + if (message.libraries && message.libraries.length) { + object.libraries = []; + for (var j = 0; j < message.libraries.length; ++j) + object.libraries[j] = $root.google.cloud.securitycenter.v1.File.toObject(message.libraries[j], options); + } + if (message.script != null && message.hasOwnProperty("script")) + object.script = $root.google.cloud.securitycenter.v1.File.toObject(message.script, options); + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = message.args[j]; + } + if (message.argumentsTruncated != null && message.hasOwnProperty("argumentsTruncated")) + object.argumentsTruncated = message.argumentsTruncated; + if (message.envVariables && message.envVariables.length) { + object.envVariables = []; + for (var j = 0; j < message.envVariables.length; ++j) + object.envVariables[j] = $root.google.cloud.securitycenter.v1.EnvironmentVariable.toObject(message.envVariables[j], options); + } + if (message.envVariablesTruncated != null && message.hasOwnProperty("envVariablesTruncated")) + object.envVariablesTruncated = message.envVariablesTruncated; + if (message.pid != null && message.hasOwnProperty("pid")) + if (typeof message.pid === "number") + object.pid = options.longs === String ? String(message.pid) : message.pid; + else + object.pid = options.longs === String ? $util.Long.prototype.toString.call(message.pid) : options.longs === Number ? new $util.LongBits(message.pid.low >>> 0, message.pid.high >>> 0).toNumber() : message.pid; + if (message.parentPid != null && message.hasOwnProperty("parentPid")) + if (typeof message.parentPid === "number") + object.parentPid = options.longs === String ? String(message.parentPid) : message.parentPid; + else + object.parentPid = options.longs === String ? $util.Long.prototype.toString.call(message.parentPid) : options.longs === Number ? new $util.LongBits(message.parentPid.low >>> 0, message.parentPid.high >>> 0).toNumber() : message.parentPid; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this Process to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Process + * @instance + * @returns {Object.} JSON object + */ + Process.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Process + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Process + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Process.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Process"; + }; + + return Process; + })(); + + v1.EnvironmentVariable = (function() { + + /** + * Properties of an EnvironmentVariable. + * @memberof google.cloud.securitycenter.v1 + * @interface IEnvironmentVariable + * @property {string|null} [name] EnvironmentVariable name + * @property {string|null} [val] EnvironmentVariable val + */ + + /** + * Constructs a new EnvironmentVariable. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an EnvironmentVariable. + * @implements IEnvironmentVariable + * @constructor + * @param {google.cloud.securitycenter.v1.IEnvironmentVariable=} [properties] Properties to set + */ + function EnvironmentVariable(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnvironmentVariable name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @instance + */ + EnvironmentVariable.prototype.name = ""; + + /** + * EnvironmentVariable val. + * @member {string} val + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @instance + */ + EnvironmentVariable.prototype.val = ""; + + /** + * Creates a new EnvironmentVariable instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {google.cloud.securitycenter.v1.IEnvironmentVariable=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.EnvironmentVariable} EnvironmentVariable instance + */ + EnvironmentVariable.create = function create(properties) { + return new EnvironmentVariable(properties); + }; + + /** + * Encodes the specified EnvironmentVariable message. Does not implicitly {@link google.cloud.securitycenter.v1.EnvironmentVariable.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {google.cloud.securitycenter.v1.IEnvironmentVariable} message EnvironmentVariable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnvironmentVariable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.val != null && Object.hasOwnProperty.call(message, "val")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.val); + return writer; + }; + + /** + * Encodes the specified EnvironmentVariable message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.EnvironmentVariable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {google.cloud.securitycenter.v1.IEnvironmentVariable} message EnvironmentVariable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnvironmentVariable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnvironmentVariable message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.EnvironmentVariable} EnvironmentVariable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnvironmentVariable.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.EnvironmentVariable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.val = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnvironmentVariable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.EnvironmentVariable} EnvironmentVariable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnvironmentVariable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnvironmentVariable message. + * @function verify + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnvironmentVariable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.val != null && message.hasOwnProperty("val")) + if (!$util.isString(message.val)) + return "val: string expected"; + return null; + }; + + /** + * Creates an EnvironmentVariable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.EnvironmentVariable} EnvironmentVariable + */ + EnvironmentVariable.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.EnvironmentVariable) + return object; + var message = new $root.google.cloud.securitycenter.v1.EnvironmentVariable(); + if (object.name != null) + message.name = String(object.name); + if (object.val != null) + message.val = String(object.val); + return message; + }; + + /** + * Creates a plain object from an EnvironmentVariable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {google.cloud.securitycenter.v1.EnvironmentVariable} message EnvironmentVariable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnvironmentVariable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.val = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.val != null && message.hasOwnProperty("val")) + object.val = message.val; + return object; + }; + + /** + * Converts this EnvironmentVariable to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @instance + * @returns {Object.} JSON object + */ + EnvironmentVariable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnvironmentVariable + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.EnvironmentVariable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnvironmentVariable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.EnvironmentVariable"; + }; + + return EnvironmentVariable; + })(); + + v1.Vulnerability = (function() { + + /** + * Properties of a Vulnerability. + * @memberof google.cloud.securitycenter.v1 + * @interface IVulnerability + * @property {google.cloud.securitycenter.v1.ICve|null} [cve] Vulnerability cve + */ + + /** + * Constructs a new Vulnerability. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Vulnerability. + * @implements IVulnerability + * @constructor + * @param {google.cloud.securitycenter.v1.IVulnerability=} [properties] Properties to set + */ + function Vulnerability(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Vulnerability cve. + * @member {google.cloud.securitycenter.v1.ICve|null|undefined} cve + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @instance + */ + Vulnerability.prototype.cve = null; + + /** + * Creates a new Vulnerability instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {google.cloud.securitycenter.v1.IVulnerability=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Vulnerability} Vulnerability instance + */ + Vulnerability.create = function create(properties) { + return new Vulnerability(properties); + }; + + /** + * Encodes the specified Vulnerability message. Does not implicitly {@link google.cloud.securitycenter.v1.Vulnerability.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {google.cloud.securitycenter.v1.IVulnerability} message Vulnerability message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vulnerability.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cve != null && Object.hasOwnProperty.call(message, "cve")) + $root.google.cloud.securitycenter.v1.Cve.encode(message.cve, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Vulnerability message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Vulnerability.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {google.cloud.securitycenter.v1.IVulnerability} message Vulnerability message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vulnerability.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vulnerability message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Vulnerability} Vulnerability + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vulnerability.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Vulnerability(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cve = $root.google.cloud.securitycenter.v1.Cve.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vulnerability message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Vulnerability} Vulnerability + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vulnerability.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vulnerability message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vulnerability.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cve != null && message.hasOwnProperty("cve")) { + var error = $root.google.cloud.securitycenter.v1.Cve.verify(message.cve); + if (error) + return "cve." + error; + } + return null; + }; + + /** + * Creates a Vulnerability message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Vulnerability} Vulnerability + */ + Vulnerability.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Vulnerability) + return object; + var message = new $root.google.cloud.securitycenter.v1.Vulnerability(); + if (object.cve != null) { + if (typeof object.cve !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Vulnerability.cve: object expected"); + message.cve = $root.google.cloud.securitycenter.v1.Cve.fromObject(object.cve); + } + return message; + }; + + /** + * Creates a plain object from a Vulnerability message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {google.cloud.securitycenter.v1.Vulnerability} message Vulnerability + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vulnerability.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cve = null; + if (message.cve != null && message.hasOwnProperty("cve")) + object.cve = $root.google.cloud.securitycenter.v1.Cve.toObject(message.cve, options); + return object; + }; + + /** + * Converts this Vulnerability to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @instance + * @returns {Object.} JSON object + */ + Vulnerability.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Vulnerability + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Vulnerability + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Vulnerability.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Vulnerability"; + }; + + return Vulnerability; + })(); + + v1.Cve = (function() { + + /** + * Properties of a Cve. + * @memberof google.cloud.securitycenter.v1 + * @interface ICve + * @property {string|null} [id] Cve id + * @property {Array.|null} [references] Cve references + * @property {google.cloud.securitycenter.v1.ICvssv3|null} [cvssv3] Cve cvssv3 + * @property {boolean|null} [upstreamFixAvailable] Cve upstreamFixAvailable + */ + + /** + * Constructs a new Cve. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Cve. + * @implements ICve + * @constructor + * @param {google.cloud.securitycenter.v1.ICve=} [properties] Properties to set + */ + function Cve(properties) { + this.references = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cve id. + * @member {string} id + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.id = ""; + + /** + * Cve references. + * @member {Array.} references + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.references = $util.emptyArray; + + /** + * Cve cvssv3. + * @member {google.cloud.securitycenter.v1.ICvssv3|null|undefined} cvssv3 + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.cvssv3 = null; + + /** + * Cve upstreamFixAvailable. + * @member {boolean} upstreamFixAvailable + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + */ + Cve.prototype.upstreamFixAvailable = false; + + /** + * Creates a new Cve instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {google.cloud.securitycenter.v1.ICve=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Cve} Cve instance + */ + Cve.create = function create(properties) { + return new Cve(properties); + }; + + /** + * Encodes the specified Cve message. Does not implicitly {@link google.cloud.securitycenter.v1.Cve.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {google.cloud.securitycenter.v1.ICve} message Cve message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cve.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.references != null && message.references.length) + for (var i = 0; i < message.references.length; ++i) + $root.google.cloud.securitycenter.v1.Reference.encode(message.references[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cvssv3 != null && Object.hasOwnProperty.call(message, "cvssv3")) + $root.google.cloud.securitycenter.v1.Cvssv3.encode(message.cvssv3, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.upstreamFixAvailable != null && Object.hasOwnProperty.call(message, "upstreamFixAvailable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.upstreamFixAvailable); + return writer; + }; + + /** + * Encodes the specified Cve message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Cve.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {google.cloud.securitycenter.v1.ICve} message Cve message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cve.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cve message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Cve} Cve + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cve.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Cve(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + if (!(message.references && message.references.length)) + message.references = []; + message.references.push($root.google.cloud.securitycenter.v1.Reference.decode(reader, reader.uint32())); + break; + } + case 3: { + message.cvssv3 = $root.google.cloud.securitycenter.v1.Cvssv3.decode(reader, reader.uint32()); + break; + } + case 4: { + message.upstreamFixAvailable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cve message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Cve} Cve + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cve.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cve message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cve.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.references != null && message.hasOwnProperty("references")) { + if (!Array.isArray(message.references)) + return "references: array expected"; + for (var i = 0; i < message.references.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Reference.verify(message.references[i]); + if (error) + return "references." + error; + } + } + if (message.cvssv3 != null && message.hasOwnProperty("cvssv3")) { + var error = $root.google.cloud.securitycenter.v1.Cvssv3.verify(message.cvssv3); + if (error) + return "cvssv3." + error; + } + if (message.upstreamFixAvailable != null && message.hasOwnProperty("upstreamFixAvailable")) + if (typeof message.upstreamFixAvailable !== "boolean") + return "upstreamFixAvailable: boolean expected"; + return null; + }; + + /** + * Creates a Cve message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Cve} Cve + */ + Cve.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Cve) + return object; + var message = new $root.google.cloud.securitycenter.v1.Cve(); + if (object.id != null) + message.id = String(object.id); + if (object.references) { + if (!Array.isArray(object.references)) + throw TypeError(".google.cloud.securitycenter.v1.Cve.references: array expected"); + message.references = []; + for (var i = 0; i < object.references.length; ++i) { + if (typeof object.references[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Cve.references: object expected"); + message.references[i] = $root.google.cloud.securitycenter.v1.Reference.fromObject(object.references[i]); + } + } + if (object.cvssv3 != null) { + if (typeof object.cvssv3 !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Cve.cvssv3: object expected"); + message.cvssv3 = $root.google.cloud.securitycenter.v1.Cvssv3.fromObject(object.cvssv3); + } + if (object.upstreamFixAvailable != null) + message.upstreamFixAvailable = Boolean(object.upstreamFixAvailable); + return message; + }; + + /** + * Creates a plain object from a Cve message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {google.cloud.securitycenter.v1.Cve} message Cve + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cve.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.references = []; + if (options.defaults) { + object.id = ""; + object.cvssv3 = null; + object.upstreamFixAvailable = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.references && message.references.length) { + object.references = []; + for (var j = 0; j < message.references.length; ++j) + object.references[j] = $root.google.cloud.securitycenter.v1.Reference.toObject(message.references[j], options); + } + if (message.cvssv3 != null && message.hasOwnProperty("cvssv3")) + object.cvssv3 = $root.google.cloud.securitycenter.v1.Cvssv3.toObject(message.cvssv3, options); + if (message.upstreamFixAvailable != null && message.hasOwnProperty("upstreamFixAvailable")) + object.upstreamFixAvailable = message.upstreamFixAvailable; + return object; + }; + + /** + * Converts this Cve to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Cve + * @instance + * @returns {Object.} JSON object + */ + Cve.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cve + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Cve + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cve.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Cve"; + }; + + return Cve; + })(); + + v1.Reference = (function() { + + /** + * Properties of a Reference. + * @memberof google.cloud.securitycenter.v1 + * @interface IReference + * @property {string|null} [source] Reference source + * @property {string|null} [uri] Reference uri + */ + + /** + * Constructs a new Reference. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Reference. + * @implements IReference + * @constructor + * @param {google.cloud.securitycenter.v1.IReference=} [properties] Properties to set + */ + function Reference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Reference source. + * @member {string} source + * @memberof google.cloud.securitycenter.v1.Reference + * @instance + */ + Reference.prototype.source = ""; + + /** + * Reference uri. + * @member {string} uri + * @memberof google.cloud.securitycenter.v1.Reference + * @instance + */ + Reference.prototype.uri = ""; + + /** + * Creates a new Reference instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {google.cloud.securitycenter.v1.IReference=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Reference} Reference instance + */ + Reference.create = function create(properties) { + return new Reference(properties); + }; + + /** + * Encodes the specified Reference message. Does not implicitly {@link google.cloud.securitycenter.v1.Reference.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {google.cloud.securitycenter.v1.IReference} message Reference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.source); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + return writer; + }; + + /** + * Encodes the specified Reference message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Reference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {google.cloud.securitycenter.v1.IReference} message Reference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Reference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Reference} Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Reference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = reader.string(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Reference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Reference} Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Reference message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Reference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a Reference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Reference} Reference + */ + Reference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Reference) + return object; + var message = new $root.google.cloud.securitycenter.v1.Reference(); + if (object.source != null) + message.source = String(object.source); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a Reference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {google.cloud.securitycenter.v1.Reference} message Reference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Reference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = ""; + object.uri = ""; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this Reference to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Reference + * @instance + * @returns {Object.} JSON object + */ + Reference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Reference + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Reference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Reference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Reference"; + }; + + return Reference; + })(); + + v1.Cvssv3 = (function() { + + /** + * Properties of a Cvssv3. + * @memberof google.cloud.securitycenter.v1 + * @interface ICvssv3 + * @property {number|null} [baseScore] Cvssv3 baseScore + * @property {google.cloud.securitycenter.v1.Cvssv3.AttackVector|null} [attackVector] Cvssv3 attackVector + * @property {google.cloud.securitycenter.v1.Cvssv3.AttackComplexity|null} [attackComplexity] Cvssv3 attackComplexity + * @property {google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired|null} [privilegesRequired] Cvssv3 privilegesRequired + * @property {google.cloud.securitycenter.v1.Cvssv3.UserInteraction|null} [userInteraction] Cvssv3 userInteraction + * @property {google.cloud.securitycenter.v1.Cvssv3.Scope|null} [scope] Cvssv3 scope + * @property {google.cloud.securitycenter.v1.Cvssv3.Impact|null} [confidentialityImpact] Cvssv3 confidentialityImpact + * @property {google.cloud.securitycenter.v1.Cvssv3.Impact|null} [integrityImpact] Cvssv3 integrityImpact + * @property {google.cloud.securitycenter.v1.Cvssv3.Impact|null} [availabilityImpact] Cvssv3 availabilityImpact + */ + + /** + * Constructs a new Cvssv3. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Cvssv3. + * @implements ICvssv3 + * @constructor + * @param {google.cloud.securitycenter.v1.ICvssv3=} [properties] Properties to set + */ + function Cvssv3(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cvssv3 baseScore. + * @member {number} baseScore + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.baseScore = 0; + + /** + * Cvssv3 attackVector. + * @member {google.cloud.securitycenter.v1.Cvssv3.AttackVector} attackVector + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.attackVector = 0; + + /** + * Cvssv3 attackComplexity. + * @member {google.cloud.securitycenter.v1.Cvssv3.AttackComplexity} attackComplexity + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.attackComplexity = 0; + + /** + * Cvssv3 privilegesRequired. + * @member {google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired} privilegesRequired + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.privilegesRequired = 0; + + /** + * Cvssv3 userInteraction. + * @member {google.cloud.securitycenter.v1.Cvssv3.UserInteraction} userInteraction + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.userInteraction = 0; + + /** + * Cvssv3 scope. + * @member {google.cloud.securitycenter.v1.Cvssv3.Scope} scope + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.scope = 0; + + /** + * Cvssv3 confidentialityImpact. + * @member {google.cloud.securitycenter.v1.Cvssv3.Impact} confidentialityImpact + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.confidentialityImpact = 0; + + /** + * Cvssv3 integrityImpact. + * @member {google.cloud.securitycenter.v1.Cvssv3.Impact} integrityImpact + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.integrityImpact = 0; + + /** + * Cvssv3 availabilityImpact. + * @member {google.cloud.securitycenter.v1.Cvssv3.Impact} availabilityImpact + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + */ + Cvssv3.prototype.availabilityImpact = 0; + + /** + * Creates a new Cvssv3 instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {google.cloud.securitycenter.v1.ICvssv3=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Cvssv3} Cvssv3 instance + */ + Cvssv3.create = function create(properties) { + return new Cvssv3(properties); + }; + + /** + * Encodes the specified Cvssv3 message. Does not implicitly {@link google.cloud.securitycenter.v1.Cvssv3.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {google.cloud.securitycenter.v1.ICvssv3} message Cvssv3 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cvssv3.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseScore != null && Object.hasOwnProperty.call(message, "baseScore")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.baseScore); + if (message.attackVector != null && Object.hasOwnProperty.call(message, "attackVector")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.attackVector); + if (message.attackComplexity != null && Object.hasOwnProperty.call(message, "attackComplexity")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.attackComplexity); + if (message.privilegesRequired != null && Object.hasOwnProperty.call(message, "privilegesRequired")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.privilegesRequired); + if (message.userInteraction != null && Object.hasOwnProperty.call(message, "userInteraction")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.userInteraction); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.scope); + if (message.confidentialityImpact != null && Object.hasOwnProperty.call(message, "confidentialityImpact")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.confidentialityImpact); + if (message.integrityImpact != null && Object.hasOwnProperty.call(message, "integrityImpact")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.integrityImpact); + if (message.availabilityImpact != null && Object.hasOwnProperty.call(message, "availabilityImpact")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.availabilityImpact); + return writer; + }; + + /** + * Encodes the specified Cvssv3 message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Cvssv3.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {google.cloud.securitycenter.v1.ICvssv3} message Cvssv3 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cvssv3.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cvssv3 message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Cvssv3} Cvssv3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cvssv3.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Cvssv3(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseScore = reader.double(); + break; + } + case 5: { + message.attackVector = reader.int32(); + break; + } + case 6: { + message.attackComplexity = reader.int32(); + break; + } + case 7: { + message.privilegesRequired = reader.int32(); + break; + } + case 8: { + message.userInteraction = reader.int32(); + break; + } + case 9: { + message.scope = reader.int32(); + break; + } + case 10: { + message.confidentialityImpact = reader.int32(); + break; + } + case 11: { + message.integrityImpact = reader.int32(); + break; + } + case 12: { + message.availabilityImpact = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cvssv3 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Cvssv3} Cvssv3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cvssv3.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cvssv3 message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cvssv3.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseScore != null && message.hasOwnProperty("baseScore")) + if (typeof message.baseScore !== "number") + return "baseScore: number 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: + break; + } + if (message.attackComplexity != null && message.hasOwnProperty("attackComplexity")) + switch (message.attackComplexity) { + default: + return "attackComplexity: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.privilegesRequired != null && message.hasOwnProperty("privilegesRequired")) + switch (message.privilegesRequired) { + default: + return "privilegesRequired: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.userInteraction != null && message.hasOwnProperty("userInteraction")) + switch (message.userInteraction) { + default: + return "userInteraction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.confidentialityImpact != null && message.hasOwnProperty("confidentialityImpact")) + switch (message.confidentialityImpact) { + default: + return "confidentialityImpact: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.integrityImpact != null && message.hasOwnProperty("integrityImpact")) + switch (message.integrityImpact) { + default: + return "integrityImpact: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.availabilityImpact != null && message.hasOwnProperty("availabilityImpact")) + switch (message.availabilityImpact) { + default: + return "availabilityImpact: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a Cvssv3 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Cvssv3} Cvssv3 + */ + Cvssv3.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Cvssv3) + return object; + var message = new $root.google.cloud.securitycenter.v1.Cvssv3(); + if (object.baseScore != null) + message.baseScore = Number(object.baseScore); + 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 "ATTACK_VECTOR_NETWORK": + case 1: + message.attackVector = 1; + break; + case "ATTACK_VECTOR_ADJACENT": + case 2: + message.attackVector = 2; + break; + case "ATTACK_VECTOR_LOCAL": + case 3: + message.attackVector = 3; + break; + case "ATTACK_VECTOR_PHYSICAL": + case 4: + message.attackVector = 4; + break; + } + switch (object.attackComplexity) { + default: + if (typeof object.attackComplexity === "number") { + message.attackComplexity = object.attackComplexity; + break; + } + break; + case "ATTACK_COMPLEXITY_UNSPECIFIED": + case 0: + message.attackComplexity = 0; + break; + case "ATTACK_COMPLEXITY_LOW": + case 1: + message.attackComplexity = 1; + break; + case "ATTACK_COMPLEXITY_HIGH": + case 2: + message.attackComplexity = 2; + break; + } + switch (object.privilegesRequired) { + default: + if (typeof object.privilegesRequired === "number") { + message.privilegesRequired = object.privilegesRequired; + break; + } + break; + case "PRIVILEGES_REQUIRED_UNSPECIFIED": + case 0: + message.privilegesRequired = 0; + break; + case "PRIVILEGES_REQUIRED_NONE": + case 1: + message.privilegesRequired = 1; + break; + case "PRIVILEGES_REQUIRED_LOW": + case 2: + message.privilegesRequired = 2; + break; + case "PRIVILEGES_REQUIRED_HIGH": + case 3: + message.privilegesRequired = 3; + break; + } + switch (object.userInteraction) { + default: + if (typeof object.userInteraction === "number") { + message.userInteraction = object.userInteraction; + break; + } + break; + case "USER_INTERACTION_UNSPECIFIED": + case 0: + message.userInteraction = 0; + break; + case "USER_INTERACTION_NONE": + case 1: + message.userInteraction = 1; + break; + case "USER_INTERACTION_REQUIRED": + case 2: + message.userInteraction = 2; + break; + } + switch (object.scope) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + case "SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "SCOPE_UNCHANGED": + case 1: + message.scope = 1; + break; + case "SCOPE_CHANGED": + case 2: + message.scope = 2; + break; + } + switch (object.confidentialityImpact) { + default: + if (typeof object.confidentialityImpact === "number") { + message.confidentialityImpact = object.confidentialityImpact; + break; + } + break; + case "IMPACT_UNSPECIFIED": + case 0: + message.confidentialityImpact = 0; + break; + case "IMPACT_HIGH": + case 1: + message.confidentialityImpact = 1; + break; + case "IMPACT_LOW": + case 2: + message.confidentialityImpact = 2; + break; + case "IMPACT_NONE": + case 3: + message.confidentialityImpact = 3; + break; + } + switch (object.integrityImpact) { + default: + if (typeof object.integrityImpact === "number") { + message.integrityImpact = object.integrityImpact; + break; + } + break; + case "IMPACT_UNSPECIFIED": + case 0: + message.integrityImpact = 0; + break; + case "IMPACT_HIGH": + case 1: + message.integrityImpact = 1; + break; + case "IMPACT_LOW": + case 2: + message.integrityImpact = 2; + break; + case "IMPACT_NONE": + case 3: + message.integrityImpact = 3; + break; + } + switch (object.availabilityImpact) { + default: + if (typeof object.availabilityImpact === "number") { + message.availabilityImpact = object.availabilityImpact; + break; + } + break; + case "IMPACT_UNSPECIFIED": + case 0: + message.availabilityImpact = 0; + break; + case "IMPACT_HIGH": + case 1: + message.availabilityImpact = 1; + break; + case "IMPACT_LOW": + case 2: + message.availabilityImpact = 2; + break; + case "IMPACT_NONE": + case 3: + message.availabilityImpact = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Cvssv3 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {google.cloud.securitycenter.v1.Cvssv3} message Cvssv3 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cvssv3.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseScore = 0; + object.attackVector = options.enums === String ? "ATTACK_VECTOR_UNSPECIFIED" : 0; + object.attackComplexity = options.enums === String ? "ATTACK_COMPLEXITY_UNSPECIFIED" : 0; + object.privilegesRequired = options.enums === String ? "PRIVILEGES_REQUIRED_UNSPECIFIED" : 0; + object.userInteraction = options.enums === String ? "USER_INTERACTION_UNSPECIFIED" : 0; + object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; + object.confidentialityImpact = options.enums === String ? "IMPACT_UNSPECIFIED" : 0; + object.integrityImpact = options.enums === String ? "IMPACT_UNSPECIFIED" : 0; + object.availabilityImpact = options.enums === String ? "IMPACT_UNSPECIFIED" : 0; + } + if (message.baseScore != null && message.hasOwnProperty("baseScore")) + object.baseScore = options.json && !isFinite(message.baseScore) ? String(message.baseScore) : message.baseScore; + if (message.attackVector != null && message.hasOwnProperty("attackVector")) + object.attackVector = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.AttackVector[message.attackVector] === undefined ? message.attackVector : $root.google.cloud.securitycenter.v1.Cvssv3.AttackVector[message.attackVector] : message.attackVector; + if (message.attackComplexity != null && message.hasOwnProperty("attackComplexity")) + object.attackComplexity = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.AttackComplexity[message.attackComplexity] === undefined ? message.attackComplexity : $root.google.cloud.securitycenter.v1.Cvssv3.AttackComplexity[message.attackComplexity] : message.attackComplexity; + if (message.privilegesRequired != null && message.hasOwnProperty("privilegesRequired")) + object.privilegesRequired = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired[message.privilegesRequired] === undefined ? message.privilegesRequired : $root.google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired[message.privilegesRequired] : message.privilegesRequired; + if (message.userInteraction != null && message.hasOwnProperty("userInteraction")) + object.userInteraction = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.UserInteraction[message.userInteraction] === undefined ? message.userInteraction : $root.google.cloud.securitycenter.v1.Cvssv3.UserInteraction[message.userInteraction] : message.userInteraction; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.securitycenter.v1.Cvssv3.Scope[message.scope] : message.scope; + if (message.confidentialityImpact != null && message.hasOwnProperty("confidentialityImpact")) + object.confidentialityImpact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.confidentialityImpact] === undefined ? message.confidentialityImpact : $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.confidentialityImpact] : message.confidentialityImpact; + if (message.integrityImpact != null && message.hasOwnProperty("integrityImpact")) + object.integrityImpact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.integrityImpact] === undefined ? message.integrityImpact : $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.integrityImpact] : message.integrityImpact; + if (message.availabilityImpact != null && message.hasOwnProperty("availabilityImpact")) + object.availabilityImpact = options.enums === String ? $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.availabilityImpact] === undefined ? message.availabilityImpact : $root.google.cloud.securitycenter.v1.Cvssv3.Impact[message.availabilityImpact] : message.availabilityImpact; + return object; + }; + + /** + * Converts this Cvssv3 to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @instance + * @returns {Object.} JSON object + */ + Cvssv3.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cvssv3 + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Cvssv3 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cvssv3.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Cvssv3"; + }; + + /** + * AttackVector enum. + * @name google.cloud.securitycenter.v1.Cvssv3.AttackVector + * @enum {number} + * @property {number} ATTACK_VECTOR_UNSPECIFIED=0 ATTACK_VECTOR_UNSPECIFIED value + * @property {number} ATTACK_VECTOR_NETWORK=1 ATTACK_VECTOR_NETWORK value + * @property {number} ATTACK_VECTOR_ADJACENT=2 ATTACK_VECTOR_ADJACENT value + * @property {number} ATTACK_VECTOR_LOCAL=3 ATTACK_VECTOR_LOCAL value + * @property {number} ATTACK_VECTOR_PHYSICAL=4 ATTACK_VECTOR_PHYSICAL value + */ + Cvssv3.AttackVector = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTACK_VECTOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "ATTACK_VECTOR_NETWORK"] = 1; + values[valuesById[2] = "ATTACK_VECTOR_ADJACENT"] = 2; + values[valuesById[3] = "ATTACK_VECTOR_LOCAL"] = 3; + values[valuesById[4] = "ATTACK_VECTOR_PHYSICAL"] = 4; + return values; + })(); + + /** + * AttackComplexity enum. + * @name google.cloud.securitycenter.v1.Cvssv3.AttackComplexity + * @enum {number} + * @property {number} ATTACK_COMPLEXITY_UNSPECIFIED=0 ATTACK_COMPLEXITY_UNSPECIFIED value + * @property {number} ATTACK_COMPLEXITY_LOW=1 ATTACK_COMPLEXITY_LOW value + * @property {number} ATTACK_COMPLEXITY_HIGH=2 ATTACK_COMPLEXITY_HIGH value + */ + Cvssv3.AttackComplexity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTACK_COMPLEXITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ATTACK_COMPLEXITY_LOW"] = 1; + values[valuesById[2] = "ATTACK_COMPLEXITY_HIGH"] = 2; + return values; + })(); + + /** + * PrivilegesRequired enum. + * @name google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired + * @enum {number} + * @property {number} PRIVILEGES_REQUIRED_UNSPECIFIED=0 PRIVILEGES_REQUIRED_UNSPECIFIED value + * @property {number} PRIVILEGES_REQUIRED_NONE=1 PRIVILEGES_REQUIRED_NONE value + * @property {number} PRIVILEGES_REQUIRED_LOW=2 PRIVILEGES_REQUIRED_LOW value + * @property {number} PRIVILEGES_REQUIRED_HIGH=3 PRIVILEGES_REQUIRED_HIGH value + */ + Cvssv3.PrivilegesRequired = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIVILEGES_REQUIRED_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIVILEGES_REQUIRED_NONE"] = 1; + values[valuesById[2] = "PRIVILEGES_REQUIRED_LOW"] = 2; + values[valuesById[3] = "PRIVILEGES_REQUIRED_HIGH"] = 3; + return values; + })(); + + /** + * UserInteraction enum. + * @name google.cloud.securitycenter.v1.Cvssv3.UserInteraction + * @enum {number} + * @property {number} USER_INTERACTION_UNSPECIFIED=0 USER_INTERACTION_UNSPECIFIED value + * @property {number} USER_INTERACTION_NONE=1 USER_INTERACTION_NONE value + * @property {number} USER_INTERACTION_REQUIRED=2 USER_INTERACTION_REQUIRED value + */ + Cvssv3.UserInteraction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_INTERACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_INTERACTION_NONE"] = 1; + values[valuesById[2] = "USER_INTERACTION_REQUIRED"] = 2; + return values; + })(); + + /** + * Scope enum. + * @name google.cloud.securitycenter.v1.Cvssv3.Scope + * @enum {number} + * @property {number} SCOPE_UNSPECIFIED=0 SCOPE_UNSPECIFIED value + * @property {number} SCOPE_UNCHANGED=1 SCOPE_UNCHANGED value + * @property {number} SCOPE_CHANGED=2 SCOPE_CHANGED value + */ + Cvssv3.Scope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCOPE_UNCHANGED"] = 1; + values[valuesById[2] = "SCOPE_CHANGED"] = 2; + return values; + })(); + + /** + * Impact enum. + * @name google.cloud.securitycenter.v1.Cvssv3.Impact + * @enum {number} + * @property {number} IMPACT_UNSPECIFIED=0 IMPACT_UNSPECIFIED value + * @property {number} IMPACT_HIGH=1 IMPACT_HIGH value + * @property {number} IMPACT_LOW=2 IMPACT_LOW value + * @property {number} IMPACT_NONE=3 IMPACT_NONE value + */ + Cvssv3.Impact = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMPACT_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMPACT_HIGH"] = 1; + values[valuesById[2] = "IMPACT_LOW"] = 2; + values[valuesById[3] = "IMPACT_NONE"] = 3; + return values; + })(); + + return Cvssv3; + })(); + + v1.MuteConfig = (function() { + + /** + * Properties of a MuteConfig. + * @memberof google.cloud.securitycenter.v1 + * @interface IMuteConfig + * @property {string|null} [name] MuteConfig name + * @property {string|null} [displayName] MuteConfig displayName + * @property {string|null} [description] MuteConfig description + * @property {string|null} [filter] MuteConfig filter + * @property {google.protobuf.ITimestamp|null} [createTime] MuteConfig createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] MuteConfig updateTime + * @property {string|null} [mostRecentEditor] MuteConfig mostRecentEditor + */ + + /** + * Constructs a new MuteConfig. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a MuteConfig. + * @implements IMuteConfig + * @constructor + * @param {google.cloud.securitycenter.v1.IMuteConfig=} [properties] Properties to set + */ + function MuteConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MuteConfig name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.name = ""; + + /** + * MuteConfig displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.displayName = ""; + + /** + * MuteConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.description = ""; + + /** + * MuteConfig filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.filter = ""; + + /** + * MuteConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.createTime = null; + + /** + * MuteConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.updateTime = null; + + /** + * MuteConfig mostRecentEditor. + * @member {string} mostRecentEditor + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + */ + MuteConfig.prototype.mostRecentEditor = ""; + + /** + * Creates a new MuteConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {google.cloud.securitycenter.v1.IMuteConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig instance + */ + MuteConfig.create = function create(properties) { + return new MuteConfig(properties); + }; + + /** + * Encodes the specified MuteConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {google.cloud.securitycenter.v1.IMuteConfig} message MuteConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MuteConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.mostRecentEditor != null && Object.hasOwnProperty.call(message, "mostRecentEditor")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.mostRecentEditor); + return writer; + }; + + /** + * Encodes the specified MuteConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.MuteConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {google.cloud.securitycenter.v1.IMuteConfig} message MuteConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MuteConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MuteConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MuteConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.MuteConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.mostRecentEditor = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MuteConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MuteConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MuteConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MuteConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.mostRecentEditor != null && message.hasOwnProperty("mostRecentEditor")) + if (!$util.isString(message.mostRecentEditor)) + return "mostRecentEditor: string expected"; + return null; + }; + + /** + * Creates a MuteConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.MuteConfig} MuteConfig + */ + MuteConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.MuteConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1.MuteConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.filter != null) + message.filter = String(object.filter); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.MuteConfig.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.MuteConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.mostRecentEditor != null) + message.mostRecentEditor = String(object.mostRecentEditor); + return message; + }; + + /** + * Creates a plain object from a MuteConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {google.cloud.securitycenter.v1.MuteConfig} message MuteConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MuteConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.filter = ""; + object.createTime = null; + object.updateTime = null; + object.mostRecentEditor = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.mostRecentEditor != null && message.hasOwnProperty("mostRecentEditor")) + object.mostRecentEditor = message.mostRecentEditor; + return object; + }; + + /** + * Converts this MuteConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @instance + * @returns {Object.} JSON object + */ + MuteConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MuteConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.MuteConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MuteConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.MuteConfig"; + }; + + return MuteConfig; + })(); + + v1.NotificationConfig = (function() { + + /** + * Properties of a NotificationConfig. + * @memberof google.cloud.securitycenter.v1 + * @interface INotificationConfig + * @property {string|null} [name] NotificationConfig name + * @property {string|null} [description] NotificationConfig description + * @property {string|null} [pubsubTopic] NotificationConfig pubsubTopic + * @property {string|null} [serviceAccount] NotificationConfig serviceAccount + * @property {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null} [streamingConfig] NotificationConfig streamingConfig + */ + + /** + * Constructs a new NotificationConfig. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a NotificationConfig. + * @implements INotificationConfig + * @constructor + * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set + */ + function NotificationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationConfig name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.name = ""; + + /** + * NotificationConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.description = ""; + + /** + * NotificationConfig pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.pubsubTopic = ""; + + /** + * NotificationConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.serviceAccount = ""; + + /** + * NotificationConfig streamingConfig. + * @member {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig|null|undefined} streamingConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.streamingConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NotificationConfig notifyConfig. + * @member {"streamingConfig"|undefined} notifyConfig + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + */ + Object.defineProperty(NotificationConfig.prototype, "notifyConfig", { + get: $util.oneOfGetter($oneOfFields = ["streamingConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NotificationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v1.INotificationConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig instance + */ + NotificationConfig.create = function create(properties) { + return new NotificationConfig(properties); + }; + + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pubsubTopic); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.serviceAccount); + if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig")) + $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.encode(message.streamingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.pubsubTopic = reader.string(); + break; + } + case 4: { + message.serviceAccount = reader.string(); + break; + } + case 5: { + message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotificationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + properties.notifyConfig = 1; + { + var error = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify(message.streamingConfig); + if (error) + return "streamingConfig." + error; + } + } + return null; + }; + + /** + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.NotificationConfig} NotificationConfig + */ + NotificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1.NotificationConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.streamingConfig != null) { + if (typeof object.streamingConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.NotificationConfig.streamingConfig: object expected"); + message.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.fromObject(object.streamingConfig); + } + return message; + }; + + /** + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v1.NotificationConfig} message NotificationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.pubsubTopic = ""; + object.serviceAccount = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + object.streamingConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.toObject(message.streamingConfig, options); + if (options.oneofs) + object.notifyConfig = "streamingConfig"; + } + return object; + }; + + /** + * Converts this NotificationConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @instance + * @returns {Object.} JSON object + */ + NotificationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NotificationConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotificationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.NotificationConfig"; + }; + + NotificationConfig.StreamingConfig = (function() { + + /** + * Properties of a StreamingConfig. + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @interface IStreamingConfig + * @property {string|null} [filter] StreamingConfig filter + */ + + /** + * Constructs a new StreamingConfig. + * @memberof google.cloud.securitycenter.v1.NotificationConfig + * @classdesc Represents a StreamingConfig. + * @implements IStreamingConfig + * @constructor + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig=} [properties] Properties to set + */ + function StreamingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingConfig filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @instance + */ + StreamingConfig.prototype.filter = ""; + + /** + * Creates a new StreamingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig instance + */ + StreamingConfig.create = function create(properties) { + return new StreamingConfig(properties); + }; + + /** + * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + return writer; + }; + + /** + * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a StreamingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} StreamingConfig + */ + StreamingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig(); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a StreamingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig} message StreamingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.filter = ""; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this StreamingConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig"; + }; + + return StreamingConfig; + })(); + + return NotificationConfig; + })(); + + v1.NotificationMessage = (function() { + + /** + * Properties of a NotificationMessage. + * @memberof google.cloud.securitycenter.v1 + * @interface INotificationMessage + * @property {string|null} [notificationConfigName] NotificationMessage notificationConfigName + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] NotificationMessage finding + * @property {google.cloud.securitycenter.v1.IResource|null} [resource] NotificationMessage resource + */ + + /** + * Constructs a new NotificationMessage. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a NotificationMessage. + * @implements INotificationMessage + * @constructor + * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set + */ + function NotificationMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationMessage notificationConfigName. + * @member {string} notificationConfigName + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @instance + */ + NotificationMessage.prototype.notificationConfigName = ""; + + /** + * NotificationMessage finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @instance + */ + NotificationMessage.prototype.finding = null; + + /** + * NotificationMessage resource. + * @member {google.cloud.securitycenter.v1.IResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @instance + */ + NotificationMessage.prototype.resource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NotificationMessage event. + * @member {"finding"|undefined} event + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @instance + */ + Object.defineProperty(NotificationMessage.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["finding"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NotificationMessage instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v1.INotificationMessage=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage instance + */ + NotificationMessage.create = function create(properties) { + return new NotificationMessage(properties); + }; + + /** + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v1.INotificationMessage} message NotificationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notificationConfigName != null && Object.hasOwnProperty.call(message, "notificationConfigName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.notificationConfigName); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.securitycenter.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.NotificationMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v1.INotificationMessage} message NotificationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.NotificationMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.notificationConfigName = reader.string(); + break; + } + case 2: { + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resource = $root.google.cloud.securitycenter.v1.Resource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationMessage message. + * @function verify + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotificationMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + if (!$util.isString(message.notificationConfigName)) + return "notificationConfigName: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + properties.event = 1; + { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.NotificationMessage} NotificationMessage + */ + NotificationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.NotificationMessage) + return object; + var message = new $root.google.cloud.securitycenter.v1.NotificationMessage(); + if (object.notificationConfigName != null) + message.notificationConfigName = String(object.notificationConfigName); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.NotificationMessage.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v1.NotificationMessage.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v1.Resource.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v1.NotificationMessage} message NotificationMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.notificationConfigName = ""; + object.resource = null; + } + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + object.notificationConfigName = message.notificationConfigName; + if (message.finding != null && message.hasOwnProperty("finding")) { + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (options.oneofs) + object.event = "finding"; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v1.Resource.toObject(message.resource, options); + return object; + }; + + /** + * Converts this NotificationMessage to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @instance + * @returns {Object.} JSON object + */ + NotificationMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NotificationMessage + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.NotificationMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotificationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.NotificationMessage"; + }; + + return NotificationMessage; + })(); + + v1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.securitycenter.v1 + * @interface IResource + * @property {string|null} [name] Resource name + * @property {string|null} [displayName] Resource displayName + * @property {string|null} [type] Resource type + * @property {string|null} [project] Resource project + * @property {string|null} [projectDisplayName] Resource projectDisplayName + * @property {string|null} [parent] Resource parent + * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {Array.|null} [folders] Resource folders + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set + */ + function Resource(properties) { + this.folders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.name = ""; + + /** + * Resource displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.displayName = ""; + + /** + * Resource type. + * @member {string} type + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.type = ""; + + /** + * Resource project. + * @member {string} project + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.project = ""; + + /** + * Resource projectDisplayName. + * @member {string} projectDisplayName + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.projectDisplayName = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.parentDisplayName = ""; + + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {google.cloud.securitycenter.v1.IResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {google.cloud.securitycenter.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.type); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {google.cloud.securitycenter.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 8: { + message.displayName = reader.string(); + break; + } + case 6: { + message.type = reader.string(); + break; + } + case 2: { + message.project = reader.string(); + break; + } + case 3: { + message.projectDisplayName = reader.string(); + break; + } + case 4: { + message.parent = reader.string(); + break; + } + case 5: { + message.parentDisplayName = reader.string(); + break; + } + case 7: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + if (!$util.isString(message.projectDisplayName)) + return "projectDisplayName: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (!$util.isString(message.parentDisplayName)) + return "parentDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Resource) + return object; + var message = new $root.google.cloud.securitycenter.v1.Resource(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.type != null) + message.type = String(object.type); + if (object.project != null) + message.project = String(object.project); + if (object.projectDisplayName != null) + message.projectDisplayName = String(object.projectDisplayName); + if (object.parent != null) + message.parent = String(object.parent); + if (object.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Resource.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {google.cloud.securitycenter.v1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.folders = []; + if (options.defaults) { + object.name = ""; + object.project = ""; + object.projectDisplayName = ""; + object.parent = ""; + object.parentDisplayName = ""; + object.type = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + object.projectDisplayName = message.projectDisplayName; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + object.parentDisplayName = message.parentDisplayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Resource"; + }; + + return Resource; + })(); + + v1.OrganizationSettings = (function() { + + /** + * Properties of an OrganizationSettings. + * @memberof google.cloud.securitycenter.v1 + * @interface IOrganizationSettings + * @property {string|null} [name] OrganizationSettings name + * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery + * @property {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + */ + + /** + * Constructs a new OrganizationSettings. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings + * @constructor + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + */ + function OrganizationSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OrganizationSettings name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.name = ""; + + /** + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.enableAssetDiscovery = false; + + /** + * OrganizationSettings assetDiscoveryConfig. + * @member {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.assetDiscoveryConfig = null; + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings instance + */ + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); + }; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.enableAssetDiscovery != null && Object.hasOwnProperty.call(message, "enableAssetDiscovery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); + if (message.assetDiscoveryConfig != null && Object.hasOwnProperty.call(message, "assetDiscoveryConfig")) + $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.enableAssetDiscovery = reader.bool(); + break; + } + case 3: { + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrganizationSettings message. + * @function verify + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrganizationSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (typeof message.enableAssetDiscovery !== "boolean") + return "enableAssetDiscovery: boolean expected"; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { + var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); + if (error) + return "assetDiscoveryConfig." + error; + } + return null; + }; + + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.OrganizationSettings} OrganizationSettings + */ + OrganizationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings) + return object; + var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableAssetDiscovery != null) + message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); + if (object.assetDiscoveryConfig != null) { + if (typeof object.assetDiscoveryConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.assetDiscoveryConfig: object expected"); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + } + return message; + }; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings} message OrganizationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrganizationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.enableAssetDiscovery = false; + object.assetDiscoveryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + object.enableAssetDiscovery = message.enableAssetDiscovery; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + return object; + }; + + /** + * Converts this OrganizationSettings to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @instance + * @returns {Object.} JSON object + */ + OrganizationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrganizationSettings + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrganizationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.OrganizationSettings"; + }; + + OrganizationSettings.AssetDiscoveryConfig = (function() { + + /** + * Properties of an AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @interface IAssetDiscoveryConfig + * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds + * @property {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + * @property {Array.|null} [folderIds] AssetDiscoveryConfig folderIds + */ + + /** + * Constructs a new AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1.OrganizationSettings + * @classdesc Represents an AssetDiscoveryConfig. + * @implements IAssetDiscoveryConfig + * @constructor + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + */ + function AssetDiscoveryConfig(properties) { + this.projectIds = []; + this.folderIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AssetDiscoveryConfig projectIds. + * @member {Array.} projectIds + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; + + /** + * AssetDiscoveryConfig inclusionMode. + * @member {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.inclusionMode = 0; + + /** + * AssetDiscoveryConfig folderIds. + * @member {Array.} folderIds + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.folderIds = $util.emptyArray; + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance + */ + AssetDiscoveryConfig.create = function create(properties) { + return new AssetDiscoveryConfig(properties); + }; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectIds != null && message.projectIds.length) + for (var i = 0; i < message.projectIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); + if (message.inclusionMode != null && Object.hasOwnProperty.call(message, "inclusionMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + if (message.folderIds != null && message.folderIds.length) + for (var i = 0; i < message.folderIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.folderIds[i]); + return writer; + }; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + } + case 2: { + message.inclusionMode = reader.int32(); + break; + } + case 3: { + if (!(message.folderIds && message.folderIds.length)) + message.folderIds = []; + message.folderIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssetDiscoveryConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssetDiscoveryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectIds != null && message.hasOwnProperty("projectIds")) { + if (!Array.isArray(message.projectIds)) + return "projectIds: array expected"; + for (var i = 0; i < message.projectIds.length; ++i) + if (!$util.isString(message.projectIds[i])) + return "projectIds: string[] expected"; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + switch (message.inclusionMode) { + default: + return "inclusionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.folderIds != null && message.hasOwnProperty("folderIds")) { + if (!Array.isArray(message.folderIds)) + return "folderIds: array expected"; + for (var i = 0; i < message.folderIds.length; ++i) + if (!$util.isString(message.folderIds[i])) + return "folderIds: string[] expected"; + } + return null; + }; + + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + */ + AssetDiscoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); + if (object.projectIds) { + if (!Array.isArray(object.projectIds)) + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); + message.projectIds = []; + for (var i = 0; i < object.projectIds.length; ++i) + message.projectIds[i] = String(object.projectIds[i]); + } + switch (object.inclusionMode) { + default: + if (typeof object.inclusionMode === "number") { + message.inclusionMode = object.inclusionMode; + break; + } + break; + case "INCLUSION_MODE_UNSPECIFIED": + case 0: + message.inclusionMode = 0; + break; + case "INCLUDE_ONLY": + case 1: + message.inclusionMode = 1; + break; + case "EXCLUDE": + case 2: + message.inclusionMode = 2; + break; + } + if (object.folderIds) { + if (!Array.isArray(object.folderIds)) + throw TypeError(".google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.folderIds: array expected"); + message.folderIds = []; + for (var i = 0; i < object.folderIds.length; ++i) + message.folderIds[i] = String(object.folderIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssetDiscoveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.projectIds = []; + object.folderIds = []; + } + if (options.defaults) + object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; + if (message.projectIds && message.projectIds.length) { + object.projectIds = []; + for (var j = 0; j < message.projectIds.length; ++j) + object.projectIds[j] = message.projectIds[j]; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] === undefined ? message.inclusionMode : $root.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + if (message.folderIds && message.folderIds.length) { + object.folderIds = []; + for (var j = 0; j < message.folderIds.length; ++j) + object.folderIds[j] = message.folderIds[j]; + } + return object; + }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @instance + * @returns {Object.} JSON object + */ + AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AssetDiscoveryConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssetDiscoveryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig"; + }; + + /** + * InclusionMode enum. + * @name google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * @enum {number} + * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value + * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value + * @property {number} EXCLUDE=2 EXCLUDE value + */ + AssetDiscoveryConfig.InclusionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCLUDE_ONLY"] = 1; + values[valuesById[2] = "EXCLUDE"] = 2; + return values; + })(); + + return AssetDiscoveryConfig; + })(); + + return OrganizationSettings; + })(); + + v1.RunAssetDiscoveryResponse = (function() { + + /** + * Properties of a RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IRunAssetDiscoveryResponse + * @property {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state + * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration + */ + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a RunAssetDiscoveryResponse. + * @implements IRunAssetDiscoveryResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + */ + function RunAssetDiscoveryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunAssetDiscoveryResponse state. + * @member {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.state = 0; + + /** + * RunAssetDiscoveryResponse duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.duration = null; + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + */ + RunAssetDiscoveryResponse.create = function create(properties) { + return new RunAssetDiscoveryResponse(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + */ + RunAssetDiscoveryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLETED": + case 1: + message.state = 1; + break; + case "SUPERSEDED": + case 2: + message.state = 2; + break; + case "TERMINATED": + case 3: + message.state = 3; + break; + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.duration = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State[message.state] : message.state; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunAssetDiscoveryResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAssetDiscoveryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.RunAssetDiscoveryResponse"; + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} COMPLETED=1 COMPLETED value + * @property {number} SUPERSEDED=2 SUPERSEDED value + * @property {number} TERMINATED=3 TERMINATED value + */ + RunAssetDiscoveryResponse.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPLETED"] = 1; + values[valuesById[2] = "SUPERSEDED"] = 2; + values[valuesById[3] = "TERMINATED"] = 3; + return values; + })(); + + return RunAssetDiscoveryResponse; + })(); + + v1.SecurityCenter = (function() { + + /** + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SecurityCenter + * @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 SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; + + /** + * Creates new SecurityCenter service using the specified rpc implementation. + * @function create + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + */ + SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|bulkMuteFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef BulkMuteFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BulkMuteFindings. + * @function bulkMuteFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest} request BulkMuteFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindingsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.bulkMuteFindings = function bulkMuteFindings(request, callback) { + return this.rpcCall(bulkMuteFindings, $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BulkMuteFindings" }); + + /** + * Calls BulkMuteFindings. + * @function bulkMuteFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest} request BulkMuteFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1.CreateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "CreateSource" }); + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { + return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1.CreateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "CreateFinding" }); + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createMuteConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.MuteConfig} [response] MuteConfig + */ + + /** + * Calls CreateMuteConfig. + * @function createMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest} request CreateMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfigCallback} callback Node-style callback called with the error, if any, and MuteConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createMuteConfig = function createMuteConfig(request, callback) { + return this.rpcCall(createMuteConfig, $root.google.cloud.securitycenter.v1.CreateMuteConfigRequest, $root.google.cloud.securitycenter.v1.MuteConfig, request, callback); + }, "name", { value: "CreateMuteConfig" }); + + /** + * Calls CreateMuteConfig. + * @function createMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest} request CreateMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createNotificationConfig = function createNotificationConfig(request, callback) { + return this.rpcCall(createNotificationConfig, $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); + }, "name", { value: "CreateNotificationConfig" }); + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteMuteConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef DeleteMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteMuteConfig. + * @function deleteMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest} request DeleteMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteMuteConfig = function deleteMuteConfig(request, callback) { + return this.rpcCall(deleteMuteConfig, $root.google.cloud.securitycenter.v1.DeleteMuteConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteMuteConfig" }); + + /** + * Calls DeleteMuteConfig. + * @function deleteMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest} request DeleteMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef DeleteNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteNotificationConfig. + * @function deleteNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteNotificationConfig = function deleteNotificationConfig(request, callback) { + return this.rpcCall(deleteNotificationConfig, $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteNotificationConfig" }); + + /** + * Calls DeleteNotificationConfig. + * @function deleteNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getBigQueryExport}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetBigQueryExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.BigQueryExport} [response] BigQueryExport + */ + + /** + * Calls GetBigQueryExport. + * @function getBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetBigQueryExportRequest} request GetBigQueryExportRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExportCallback} callback Node-style callback called with the error, if any, and BigQueryExport + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getBigQueryExport = function getBigQueryExport(request, callback) { + return this.rpcCall(getBigQueryExport, $root.google.cloud.securitycenter.v1.GetBigQueryExportRequest, $root.google.cloud.securitycenter.v1.BigQueryExport, request, callback); + }, "name", { value: "GetBigQueryExport" }); + + /** + * Calls GetBigQueryExport. + * @function getBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetBigQueryExportRequest} request GetBigQueryExportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getMuteConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.MuteConfig} [response] MuteConfig + */ + + /** + * Calls GetMuteConfig. + * @function getMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest} request GetMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfigCallback} callback Node-style callback called with the error, if any, and MuteConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getMuteConfig = function getMuteConfig(request, callback) { + return this.rpcCall(getMuteConfig, $root.google.cloud.securitycenter.v1.GetMuteConfigRequest, $root.google.cloud.securitycenter.v1.MuteConfig, request, callback); + }, "name", { value: "GetMuteConfig" }); + + /** + * Calls GetMuteConfig. + * @function getMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest} request GetMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getNotificationConfig = function getNotificationConfig(request, callback) { + return this.rpcCall(getNotificationConfig, $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); + }, "name", { value: "GetNotificationConfig" }); + + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { + return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "GetOrganizationSettings" }); + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|getSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1.GetSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "GetSource" }); + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|groupAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} [response] GroupAssetsResponse + */ + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { + return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1.GroupAssetsResponse, request, callback); + }, "name", { value: "GroupAssets" }); + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|groupFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} [response] GroupFindingsResponse + */ + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { + return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listAssets}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1.ListAssetsRequest, $root.google.cloud.securitycenter.v1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listFindings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListFindingsResponse} [response] ListFindingsResponse + */ + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1.ListFindingsRequest, $root.google.cloud.securitycenter.v1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listMuteConfigs}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListMuteConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListMuteConfigsResponse} [response] ListMuteConfigsResponse + */ + + /** + * Calls ListMuteConfigs. + * @function listMuteConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest} request ListMuteConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigsCallback} callback Node-style callback called with the error, if any, and ListMuteConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listMuteConfigs = function listMuteConfigs(request, callback) { + return this.rpcCall(listMuteConfigs, $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest, $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse, request, callback); + }, "name", { value: "ListMuteConfigs" }); + + /** + * Calls ListMuteConfigs. + * @function listMuteConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest} request ListMuteConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listNotificationConfigs}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListNotificationConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} [response] ListNotificationConfigsResponse + */ + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigsCallback} callback Node-style callback called with the error, if any, and ListNotificationConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listNotificationConfigs = function listNotificationConfigs(request, callback) { + return this.rpcCall(listNotificationConfigs, $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest, $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse, request, callback); + }, "name", { value: "ListNotificationConfigs" }); + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listSources}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListSourcesResponse} [response] ListSourcesResponse + */ + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1.ListSourcesRequest, $root.google.cloud.securitycenter.v1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|runAssetDiscovery}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef RunAssetDiscoveryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { + return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunAssetDiscovery" }); + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|setFindingState}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { + return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "SetFindingState" }); + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|setMute}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetMuteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls SetMute. + * @function setMute + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetMuteRequest} request SetMuteRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetMuteCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setMute = function setMute(request, callback) { + return this.rpcCall(setMute, $root.google.cloud.securitycenter.v1.SetMuteRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "SetMute" }); + + /** + * Calls SetMute. + * @function setMute + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ISetMuteRequest} request SetMuteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|setIamPolicy}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|testIamPermissions}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateExternalSystem}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateExternalSystemCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ExternalSystem} [response] ExternalSystem + */ + + /** + * Calls UpdateExternalSystem. + * @function updateExternalSystem + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateExternalSystemRequest} request UpdateExternalSystemRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystemCallback} callback Node-style callback called with the error, if any, and ExternalSystem + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateExternalSystem = function updateExternalSystem(request, callback) { + return this.rpcCall(updateExternalSystem, $root.google.cloud.securitycenter.v1.UpdateExternalSystemRequest, $root.google.cloud.securitycenter.v1.ExternalSystem, request, callback); + }, "name", { value: "UpdateExternalSystem" }); + + /** + * Calls UpdateExternalSystem. + * @function updateExternalSystem + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateExternalSystemRequest} request UpdateExternalSystemRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateFinding}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Finding} [response] Finding + */ + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { + return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateMuteConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateMuteConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.MuteConfig} [response] MuteConfig + */ + + /** + * Calls UpdateMuteConfig. + * @function updateMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest} request UpdateMuteConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfigCallback} callback Node-style callback called with the error, if any, and MuteConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateMuteConfig = function updateMuteConfig(request, callback) { + return this.rpcCall(updateMuteConfig, $root.google.cloud.securitycenter.v1.UpdateMuteConfigRequest, $root.google.cloud.securitycenter.v1.MuteConfig, request, callback); + }, "name", { value: "UpdateMuteConfig" }); + + /** + * Calls UpdateMuteConfig. + * @function updateMuteConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest} request UpdateMuteConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateNotificationConfig}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateNotificationConfig = function updateNotificationConfig(request, callback) { + return this.rpcCall(updateNotificationConfig, $root.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest, $root.google.cloud.securitycenter.v1.NotificationConfig, request, callback); + }, "name", { value: "UpdateNotificationConfig" }); + + /** + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { + return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1.OrganizationSettings, request, callback); + }, "name", { value: "UpdateOrganizationSettings" }); + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateSource}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.Source} [response] Source + */ + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1.Source, request, callback); + }, "name", { value: "UpdateSource" }); + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateSecurityMarksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.SecurityMarks} [response] SecurityMarks + */ + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { + return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|createBigQueryExport}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef CreateBigQueryExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.BigQueryExport} [response] BigQueryExport + */ + + /** + * Calls CreateBigQueryExport. + * @function createBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest} request CreateBigQueryExportRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExportCallback} callback Node-style callback called with the error, if any, and BigQueryExport + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createBigQueryExport = function createBigQueryExport(request, callback) { + return this.rpcCall(createBigQueryExport, $root.google.cloud.securitycenter.v1.CreateBigQueryExportRequest, $root.google.cloud.securitycenter.v1.BigQueryExport, request, callback); + }, "name", { value: "CreateBigQueryExport" }); + + /** + * Calls CreateBigQueryExport. + * @function createBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest} request CreateBigQueryExportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|deleteBigQueryExport}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef DeleteBigQueryExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBigQueryExport. + * @function deleteBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest} request DeleteBigQueryExportRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExportCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteBigQueryExport = function deleteBigQueryExport(request, callback) { + return this.rpcCall(deleteBigQueryExport, $root.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBigQueryExport" }); + + /** + * Calls DeleteBigQueryExport. + * @function deleteBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest} request DeleteBigQueryExportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|updateBigQueryExport}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef UpdateBigQueryExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.BigQueryExport} [response] BigQueryExport + */ + + /** + * Calls UpdateBigQueryExport. + * @function updateBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest} request UpdateBigQueryExportRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExportCallback} callback Node-style callback called with the error, if any, and BigQueryExport + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateBigQueryExport = function updateBigQueryExport(request, callback) { + return this.rpcCall(updateBigQueryExport, $root.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest, $root.google.cloud.securitycenter.v1.BigQueryExport, request, callback); + }, "name", { value: "UpdateBigQueryExport" }); + + /** + * Calls UpdateBigQueryExport. + * @function updateBigQueryExport + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest} request UpdateBigQueryExportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1.SecurityCenter|listBigQueryExports}. + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @typedef ListBigQueryExportsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1.ListBigQueryExportsResponse} [response] ListBigQueryExportsResponse + */ + + /** + * Calls ListBigQueryExports. + * @function listBigQueryExports + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsRequest} request ListBigQueryExportsRequest message or plain object + * @param {google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExportsCallback} callback Node-style callback called with the error, if any, and ListBigQueryExportsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listBigQueryExports = function listBigQueryExports(request, callback) { + return this.rpcCall(listBigQueryExports, $root.google.cloud.securitycenter.v1.ListBigQueryExportsRequest, $root.google.cloud.securitycenter.v1.ListBigQueryExportsResponse, request, callback); + }, "name", { value: "ListBigQueryExports" }); + + /** + * Calls ListBigQueryExports. + * @function listBigQueryExports + * @memberof google.cloud.securitycenter.v1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsRequest} request ListBigQueryExportsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecurityCenter; + })(); + + v1.BulkMuteFindingsRequest = (function() { + + /** + * Properties of a BulkMuteFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IBulkMuteFindingsRequest + * @property {string|null} [parent] BulkMuteFindingsRequest parent + * @property {string|null} [filter] BulkMuteFindingsRequest filter + * @property {string|null} [muteAnnotation] BulkMuteFindingsRequest muteAnnotation + */ + + /** + * Constructs a new BulkMuteFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a BulkMuteFindingsRequest. + * @implements IBulkMuteFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest=} [properties] Properties to set + */ + function BulkMuteFindingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BulkMuteFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @instance + */ + BulkMuteFindingsRequest.prototype.parent = ""; + + /** + * BulkMuteFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @instance + */ + BulkMuteFindingsRequest.prototype.filter = ""; + + /** + * BulkMuteFindingsRequest muteAnnotation. + * @member {string} muteAnnotation + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @instance + */ + BulkMuteFindingsRequest.prototype.muteAnnotation = ""; + + /** + * Creates a new BulkMuteFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest instance + */ + BulkMuteFindingsRequest.create = function create(properties) { + return new BulkMuteFindingsRequest(properties); + }; + + /** + * Encodes the specified BulkMuteFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest} message BulkMuteFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkMuteFindingsRequest.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.muteAnnotation != null && Object.hasOwnProperty.call(message, "muteAnnotation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.muteAnnotation); + return writer; + }; + + /** + * Encodes the specified BulkMuteFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsRequest} message BulkMuteFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkMuteFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BulkMuteFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkMuteFindingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest(); + 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.muteAnnotation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BulkMuteFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkMuteFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BulkMuteFindingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BulkMuteFindingsRequest.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.muteAnnotation != null && message.hasOwnProperty("muteAnnotation")) + if (!$util.isString(message.muteAnnotation)) + return "muteAnnotation: string expected"; + return null; + }; + + /** + * Creates a BulkMuteFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} BulkMuteFindingsRequest + */ + BulkMuteFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.BulkMuteFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.muteAnnotation != null) + message.muteAnnotation = String(object.muteAnnotation); + return message; + }; + + /** + * Creates a plain object from a BulkMuteFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.BulkMuteFindingsRequest} message BulkMuteFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BulkMuteFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.muteAnnotation = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.muteAnnotation != null && message.hasOwnProperty("muteAnnotation")) + object.muteAnnotation = message.muteAnnotation; + return object; + }; + + /** + * Converts this BulkMuteFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + BulkMuteFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BulkMuteFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BulkMuteFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.BulkMuteFindingsRequest"; + }; + + return BulkMuteFindingsRequest; + })(); + + v1.BulkMuteFindingsResponse = (function() { + + /** + * Properties of a BulkMuteFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IBulkMuteFindingsResponse + */ + + /** + * Constructs a new BulkMuteFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a BulkMuteFindingsResponse. + * @implements IBulkMuteFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsResponse=} [properties] Properties to set + */ + function BulkMuteFindingsResponse(properties) { + if (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 BulkMuteFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse instance + */ + BulkMuteFindingsResponse.create = function create(properties) { + return new BulkMuteFindingsResponse(properties); + }; + + /** + * Encodes the specified BulkMuteFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsResponse} message BulkMuteFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkMuteFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified BulkMuteFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.BulkMuteFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IBulkMuteFindingsResponse} message BulkMuteFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkMuteFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkMuteFindingsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.BulkMuteFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BulkMuteFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkMuteFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BulkMuteFindingsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BulkMuteFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a BulkMuteFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} BulkMuteFindingsResponse + */ + BulkMuteFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.BulkMuteFindingsResponse) + return object; + return new $root.google.cloud.securitycenter.v1.BulkMuteFindingsResponse(); + }; + + /** + * Creates a plain object from a BulkMuteFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.BulkMuteFindingsResponse} message BulkMuteFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BulkMuteFindingsResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BulkMuteFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + BulkMuteFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BulkMuteFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.BulkMuteFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BulkMuteFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.BulkMuteFindingsResponse"; + }; + + return BulkMuteFindingsResponse; + })(); + + v1.CreateFindingRequest = (function() { + + /** + * Properties of a CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] CreateFindingRequest finding + */ + + /** + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + */ + function CreateFindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateFindingRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.parent = ""; + + /** + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.findingId = ""; + + /** + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.finding = null; + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest instance + */ + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); + }; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.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.findingId != null && Object.hasOwnProperty.call(message, "findingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.findingId = reader.string(); + break; + } + case 3: { + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFindingRequest.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.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + return null; + }; + + /** + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateFindingRequest} CreateFindingRequest + */ + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateFindingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.findingId != null) + message.findingId = String(object.findingId); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + return message; + }; + + /** + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateFindingRequest} message CreateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.findingId = ""; + object.finding = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + return object; + }; + + /** + * Converts this CreateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CreateFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateFindingRequest"; + }; + + return CreateFindingRequest; + })(); + + v1.CreateMuteConfigRequest = (function() { + + /** + * Properties of a CreateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateMuteConfigRequest + * @property {string|null} [parent] CreateMuteConfigRequest parent + * @property {google.cloud.securitycenter.v1.IMuteConfig|null} [muteConfig] CreateMuteConfigRequest muteConfig + * @property {string|null} [muteConfigId] CreateMuteConfigRequest muteConfigId + */ + + /** + * Constructs a new CreateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateMuteConfigRequest. + * @implements ICreateMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest=} [properties] Properties to set + */ + function CreateMuteConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMuteConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @instance + */ + CreateMuteConfigRequest.prototype.parent = ""; + + /** + * CreateMuteConfigRequest muteConfig. + * @member {google.cloud.securitycenter.v1.IMuteConfig|null|undefined} muteConfig + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @instance + */ + CreateMuteConfigRequest.prototype.muteConfig = null; + + /** + * CreateMuteConfigRequest muteConfigId. + * @member {string} muteConfigId + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @instance + */ + CreateMuteConfigRequest.prototype.muteConfigId = ""; + + /** + * Creates a new CreateMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateMuteConfigRequest} CreateMuteConfigRequest instance + */ + CreateMuteConfigRequest.create = function create(properties) { + return new CreateMuteConfigRequest(properties); + }; + + /** + * Encodes the specified CreateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest} message CreateMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMuteConfigRequest.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.muteConfig != null && Object.hasOwnProperty.call(message, "muteConfig")) + $root.google.cloud.securitycenter.v1.MuteConfig.encode(message.muteConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.muteConfigId != null && Object.hasOwnProperty.call(message, "muteConfigId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.muteConfigId); + return writer; + }; + + /** + * Encodes the specified CreateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateMuteConfigRequest} message CreateMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateMuteConfigRequest} CreateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMuteConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateMuteConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.muteConfigId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateMuteConfigRequest} CreateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMuteConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMuteConfigRequest.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.muteConfig != null && message.hasOwnProperty("muteConfig")) { + var error = $root.google.cloud.securitycenter.v1.MuteConfig.verify(message.muteConfig); + if (error) + return "muteConfig." + error; + } + if (message.muteConfigId != null && message.hasOwnProperty("muteConfigId")) + if (!$util.isString(message.muteConfigId)) + return "muteConfigId: string expected"; + return null; + }; + + /** + * Creates a CreateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateMuteConfigRequest} CreateMuteConfigRequest + */ + CreateMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateMuteConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.muteConfig != null) { + if (typeof object.muteConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateMuteConfigRequest.muteConfig: object expected"); + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.fromObject(object.muteConfig); + } + if (object.muteConfigId != null) + message.muteConfigId = String(object.muteConfigId); + return message; + }; + + /** + * Creates a plain object from a CreateMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateMuteConfigRequest} message CreateMuteConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMuteConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.muteConfig = null; + object.muteConfigId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) + object.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.toObject(message.muteConfig, options); + if (message.muteConfigId != null && message.hasOwnProperty("muteConfigId")) + object.muteConfigId = message.muteConfigId; + return object; + }; + + /** + * Converts this CreateMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMuteConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CreateMuteConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMuteConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateMuteConfigRequest"; + }; + + return CreateMuteConfigRequest; + })(); + + v1.CreateNotificationConfigRequest = (function() { + + /** + * Properties of a CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateNotificationConfigRequest + * @property {string|null} [parent] CreateNotificationConfigRequest parent + * @property {string|null} [configId] CreateNotificationConfigRequest configId + * @property {google.cloud.securitycenter.v1.INotificationConfig|null} [notificationConfig] CreateNotificationConfigRequest notificationConfig + */ + + /** + * Constructs a new CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateNotificationConfigRequest. + * @implements ICreateNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest=} [properties] Properties to set + */ + function CreateNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateNotificationConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.parent = ""; + + /** + * CreateNotificationConfigRequest configId. + * @member {string} configId + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.configId = ""; + + /** + * CreateNotificationConfigRequest notificationConfig. + * @member {google.cloud.securitycenter.v1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.notificationConfig = null; + + /** + * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest instance + */ + CreateNotificationConfigRequest.create = function create(properties) { + return new CreateNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateNotificationConfigRequest.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.configId != null && Object.hasOwnProperty.call(message, "configId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.cloud.securitycenter.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateNotificationConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.configId = reader.string(); + break; + } + case 3: { + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateNotificationConfigRequest.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.configId != null && message.hasOwnProperty("configId")) + if (!$util.isString(message.configId)) + return "configId: string expected"; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.securitycenter.v1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + return null; + }; + + /** + * Creates a CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + */ + CreateNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateNotificationConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.configId != null) + message.configId = String(object.configId); + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateNotificationConfigRequest.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.fromObject(object.notificationConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateNotificationConfigRequest} message CreateNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateNotificationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.configId = ""; + object.notificationConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.configId != null && message.hasOwnProperty("configId")) + object.configId = message.configId; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.toObject(message.notificationConfig, options); + return object; + }; + + /** + * Converts this CreateNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CreateNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateNotificationConfigRequest"; + }; + + return CreateNotificationConfigRequest; + })(); + + v1.CreateSourceRequest = (function() { + + /** + * Properties of a CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v1.ISource|null} [source] CreateSourceRequest source + */ + + /** + * Constructs a new CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + */ + function CreateSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.parent = ""; + + /** + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.source = null; + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest instance + */ + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); + }; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.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.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSourceRequest.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.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; + + /** + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateSourceRequest} CreateSourceRequest + */ + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); + } + return message; + }; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateSourceRequest} message CreateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.source = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + return object; + }; + + /** + * Converts this CreateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CreateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateSourceRequest"; + }; + + return CreateSourceRequest; + })(); + + v1.DeleteMuteConfigRequest = (function() { + + /** + * Properties of a DeleteMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IDeleteMuteConfigRequest + * @property {string|null} [name] DeleteMuteConfigRequest name + */ + + /** + * Constructs a new DeleteMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a DeleteMuteConfigRequest. + * @implements IDeleteMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest=} [properties] Properties to set + */ + function DeleteMuteConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteMuteConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @instance + */ + DeleteMuteConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} DeleteMuteConfigRequest instance + */ + DeleteMuteConfigRequest.create = function create(properties) { + return new DeleteMuteConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest} message DeleteMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMuteConfigRequest.encode = function encode(message, writer) { + 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 DeleteMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteMuteConfigRequest} message DeleteMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} DeleteMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMuteConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.DeleteMuteConfigRequest(); + 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 DeleteMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} DeleteMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteMuteConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteMuteConfigRequest.verify = function verify(message) { + if (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 DeleteMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} DeleteMuteConfigRequest + */ + DeleteMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.DeleteMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.DeleteMuteConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.DeleteMuteConfigRequest} message DeleteMuteConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteMuteConfigRequest.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 DeleteMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteMuteConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.DeleteMuteConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMuteConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.DeleteMuteConfigRequest"; + }; + + return DeleteMuteConfigRequest; + })(); + + v1.DeleteNotificationConfigRequest = (function() { + + /** + * Properties of a DeleteNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IDeleteNotificationConfigRequest + * @property {string|null} [name] DeleteNotificationConfigRequest name + */ + + /** + * Constructs a new DeleteNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a DeleteNotificationConfigRequest. + * @implements IDeleteNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest=} [properties] Properties to set + */ + function DeleteNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @instance + */ + DeleteNotificationConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest instance + */ + DeleteNotificationConfigRequest.create = function create(properties) { + return new DeleteNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNotificationConfigRequest.encode = function encode(message, writer) { + 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 DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNotificationConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest(); + 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 DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteNotificationConfigRequest.verify = function verify(message) { + if (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 DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + */ + DeleteNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.DeleteNotificationConfigRequest} message DeleteNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteNotificationConfigRequest.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 DeleteNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.DeleteNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.DeleteNotificationConfigRequest"; + }; + + return DeleteNotificationConfigRequest; + })(); + + v1.GetBigQueryExportRequest = (function() { + + /** + * Properties of a GetBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetBigQueryExportRequest + * @property {string|null} [name] GetBigQueryExportRequest name + */ + + /** + * Constructs a new GetBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetBigQueryExportRequest. + * @implements IGetBigQueryExportRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetBigQueryExportRequest=} [properties] Properties to set + */ + function GetBigQueryExportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBigQueryExportRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @instance + */ + GetBigQueryExportRequest.prototype.name = ""; + + /** + * Creates a new GetBigQueryExportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetBigQueryExportRequest} GetBigQueryExportRequest instance + */ + GetBigQueryExportRequest.create = function create(properties) { + return new GetBigQueryExportRequest(properties); + }; + + /** + * Encodes the specified GetBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetBigQueryExportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetBigQueryExportRequest} message GetBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBigQueryExportRequest.encode = function encode(message, writer) { + 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 GetBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetBigQueryExportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetBigQueryExportRequest} message GetBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBigQueryExportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetBigQueryExportRequest} GetBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBigQueryExportRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetBigQueryExportRequest(); + 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 GetBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetBigQueryExportRequest} GetBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBigQueryExportRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBigQueryExportRequest.verify = function verify(message) { + if (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 GetBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetBigQueryExportRequest} GetBigQueryExportRequest + */ + GetBigQueryExportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetBigQueryExportRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetBigQueryExportRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBigQueryExportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.GetBigQueryExportRequest} message GetBigQueryExportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBigQueryExportRequest.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 GetBigQueryExportRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @instance + * @returns {Object.} JSON object + */ + GetBigQueryExportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBigQueryExportRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetBigQueryExportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBigQueryExportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetBigQueryExportRequest"; + }; + + return GetBigQueryExportRequest; + })(); + + v1.GetMuteConfigRequest = (function() { + + /** + * Properties of a GetMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetMuteConfigRequest + * @property {string|null} [name] GetMuteConfigRequest name + */ + + /** + * Constructs a new GetMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetMuteConfigRequest. + * @implements IGetMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest=} [properties] Properties to set + */ + function GetMuteConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMuteConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @instance + */ + GetMuteConfigRequest.prototype.name = ""; + + /** + * Creates a new GetMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest instance + */ + GetMuteConfigRequest.create = function create(properties) { + return new GetMuteConfigRequest(properties); + }; + + /** + * Encodes the specified GetMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest} message GetMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMuteConfigRequest.encode = function encode(message, writer) { + 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 GetMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetMuteConfigRequest} message GetMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMuteConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetMuteConfigRequest(); + 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 GetMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMuteConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMuteConfigRequest.verify = function verify(message) { + if (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 GetMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetMuteConfigRequest} GetMuteConfigRequest + */ + GetMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetMuteConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.GetMuteConfigRequest} message GetMuteConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMuteConfigRequest.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 GetMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMuteConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetMuteConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMuteConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetMuteConfigRequest"; + }; + + return GetMuteConfigRequest; + })(); + + v1.GetNotificationConfigRequest = (function() { + + /** + * Properties of a GetNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetNotificationConfigRequest + * @property {string|null} [name] GetNotificationConfigRequest name + */ + + /** + * Constructs a new GetNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetNotificationConfigRequest. + * @implements IGetNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest=} [properties] Properties to set + */ + function GetNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @instance + */ + GetNotificationConfigRequest.prototype.name = ""; + + /** + * Creates a new GetNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest instance + */ + GetNotificationConfigRequest.create = function create(properties) { + return new GetNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNotificationConfigRequest.encode = function encode(message, writer) { + 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 GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNotificationConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest(); + 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 GetNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNotificationConfigRequest.verify = function verify(message) { + if (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 GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetNotificationConfigRequest} GetNotificationConfigRequest + */ + GetNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetNotificationConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.GetNotificationConfigRequest} message GetNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNotificationConfigRequest.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 GetNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetNotificationConfigRequest"; + }; + + return GetNotificationConfigRequest; + })(); + + v1.GetOrganizationSettingsRequest = (function() { + + /** + * Properties of a GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name + */ + + /** + * Constructs a new GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetOrganizationSettingsRequest. + * @implements IGetOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + */ + function GetOrganizationSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOrganizationSettingsRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @instance + */ + GetOrganizationSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance + */ + GetOrganizationSettingsRequest.create = function create(properties) { + return new GetOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationSettingsRequest.encode = function encode(message, writer) { + 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 GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationSettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); + 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 GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOrganizationSettingsRequest.verify = function verify(message) { + if (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 GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + */ + GetOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOrganizationSettingsRequest.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 GetOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOrganizationSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOrganizationSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetOrganizationSettingsRequest"; + }; + + return GetOrganizationSettingsRequest; + })(); + + v1.GetSourceRequest = (function() { + + /** + * Properties of a GetSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name + */ + + /** + * Constructs a new GetSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + */ + function GetSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSourceRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @instance + */ + GetSourceRequest.prototype.name = ""; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest instance + */ + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); + }; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.encode = function encode(message, writer) { + 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 GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GetSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); + 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 GetSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSourceRequest.verify = function verify(message) { + if (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 GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GetSourceRequest} GetSourceRequest + */ + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GetSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GetSourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.GetSourceRequest} message GetSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSourceRequest.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 GetSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GetSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GetSourceRequest"; + }; + + return GetSourceRequest; + })(); + + v1.GroupAssetsRequest = (function() { + + /** + * Properties of a GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupAssetsRequest + * @property {string|null} [parent] GroupAssetsRequest parent + * @property {string|null} [filter] GroupAssetsRequest filter + * @property {string|null} [groupBy] GroupAssetsRequest groupBy + * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime + * @property {string|null} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize + */ + + /** + * Constructs a new GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + */ + function GroupAssetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.parent = ""; + + /** + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.filter = ""; + + /** + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.groupBy = ""; + + /** + * GroupAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.compareDuration = null; + + /** + * GroupAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.readTime = null; + + /** + * GroupAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageToken = ""; + + /** + * GroupAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest instance + */ + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); + }; + + /** + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsRequest.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.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); + 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.groupBy = reader.string(); + break; + } + case 4: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupAssetsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupAssetsRequest.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.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + 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 GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupAssetsRequest} GroupAssetsRequest + */ + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + 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 GroupAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.GroupAssetsRequest} message GroupAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.compareDuration = null; + object.readTime = null; + 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.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + 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 GroupAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GroupAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GroupAssetsRequest"; + }; + + return GroupAssetsRequest; + })(); + + v1.GroupAssetsResponse = (function() { + + /** + * Properties of a GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupAssetsResponse + * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime + * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken + * @property {number|null} [totalSize] GroupAssetsResponse totalSize + */ + + /** + * Constructs a new GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + */ + function GroupAssetsResponse(properties) { + this.groupByResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupAssetsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.readTime = null; + + /** + * GroupAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.nextPageToken = ""; + + /** + * GroupAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse instance + */ + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); + }; + + /** + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupAssetsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupAssetsResponse} GroupAssetsResponse + */ + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupAssetsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupAssetsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.GroupAssetsResponse} message GroupAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this GroupAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GroupAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GroupAssetsResponse"; + }; + + return GroupAssetsResponse; + })(); + + v1.GroupFindingsRequest = (function() { + + /** + * Properties of a GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize + */ + + /** + * Constructs a new GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + */ + function GroupFindingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.parent = ""; + + /** + * GroupFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.filter = ""; + + /** + * GroupFindingsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.groupBy = ""; + + /** + * GroupFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.readTime = null; + + /** + * GroupFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.compareDuration = null; + + /** + * GroupFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageToken = ""; + + /** + * GroupFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest instance + */ + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); + }; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsRequest.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.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); + 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.groupBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupFindingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupFindingsRequest.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.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + 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 GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupFindingsRequest} GroupFindingsRequest + */ + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + 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 GroupFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.GroupFindingsRequest} message GroupFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.readTime = null; + object.compareDuration = null; + 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.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + 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 GroupFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GroupFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GroupFindingsRequest"; + }; + + return GroupFindingsRequest; + })(); + + v1.GroupFindingsResponse = (function() { + + /** + * Properties of a GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken + * @property {number|null} [totalSize] GroupFindingsResponse totalSize + */ + + /** + * Constructs a new GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + */ + function GroupFindingsResponse(properties) { + this.groupByResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupFindingsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.readTime = null; + + /** + * GroupFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.nextPageToken = ""; + + /** + * GroupFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse instance + */ + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); + }; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1.GroupResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupFindingsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupFindingsResponse} GroupFindingsResponse + */ + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupFindingsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.GroupFindingsResponse} message GroupFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GroupFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GroupFindingsResponse"; + }; + + return GroupFindingsResponse; + })(); + + v1.GroupResult = (function() { + + /** + * Properties of a GroupResult. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count + */ + + /** + * Constructs a new GroupResult. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupResult. + * @implements IGroupResult + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + */ + function GroupResult(properties) { + this.properties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupResult properties. + * @member {Object.} properties + * @memberof google.cloud.securitycenter.v1.GroupResult + * @instance + */ + GroupResult.prototype.properties = $util.emptyObject; + + /** + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1.GroupResult + * @instance + */ + GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new GroupResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult instance + */ + GroupResult.create = function create(properties) { + return new GroupResult(properties); + }; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1.IGroupResult} message GroupResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.properties === $util.emptyObject) + message.properties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; + break; + } + case 2: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupResult} GroupResult + */ + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupResult) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.GroupResult.properties: object expected"); + message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + } + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1.GroupResult} message GroupResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); + } + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this GroupResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupResult + * @instance + * @returns {Object.} JSON object + */ + GroupResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GroupResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GroupResult"; + }; + + return GroupResult; + })(); + + v1.ListMuteConfigsRequest = (function() { + + /** + * Properties of a ListMuteConfigsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListMuteConfigsRequest + * @property {string|null} [parent] ListMuteConfigsRequest parent + * @property {number|null} [pageSize] ListMuteConfigsRequest pageSize + * @property {string|null} [pageToken] ListMuteConfigsRequest pageToken + */ + + /** + * Constructs a new ListMuteConfigsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListMuteConfigsRequest. + * @implements IListMuteConfigsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest=} [properties] Properties to set + */ + function ListMuteConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMuteConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @instance + */ + ListMuteConfigsRequest.prototype.parent = ""; + + /** + * ListMuteConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @instance + */ + ListMuteConfigsRequest.prototype.pageSize = 0; + + /** + * ListMuteConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @instance + */ + ListMuteConfigsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListMuteConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest instance + */ + ListMuteConfigsRequest.create = function create(properties) { + return new ListMuteConfigsRequest(properties); + }; + + /** + * Encodes the specified ListMuteConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest} message ListMuteConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMuteConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListMuteConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListMuteConfigsRequest} message ListMuteConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMuteConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMuteConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMuteConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMuteConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMuteConfigsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMuteConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListMuteConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsRequest} ListMuteConfigsRequest + */ + ListMuteConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListMuteConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListMuteConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.ListMuteConfigsRequest} message ListMuteConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMuteConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListMuteConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListMuteConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMuteConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMuteConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListMuteConfigsRequest"; + }; + + return ListMuteConfigsRequest; + })(); + + v1.ListMuteConfigsResponse = (function() { + + /** + * Properties of a ListMuteConfigsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListMuteConfigsResponse + * @property {Array.|null} [muteConfigs] ListMuteConfigsResponse muteConfigs + * @property {string|null} [nextPageToken] ListMuteConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListMuteConfigsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListMuteConfigsResponse. + * @implements IListMuteConfigsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse=} [properties] Properties to set + */ + function ListMuteConfigsResponse(properties) { + this.muteConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMuteConfigsResponse muteConfigs. + * @member {Array.} muteConfigs + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @instance + */ + ListMuteConfigsResponse.prototype.muteConfigs = $util.emptyArray; + + /** + * ListMuteConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @instance + */ + ListMuteConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMuteConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse instance + */ + ListMuteConfigsResponse.create = function create(properties) { + return new ListMuteConfigsResponse(properties); + }; + + /** + * Encodes the specified ListMuteConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse} message ListMuteConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMuteConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.muteConfigs != null && message.muteConfigs.length) + for (var i = 0; i < message.muteConfigs.length; ++i) + $root.google.cloud.securitycenter.v1.MuteConfig.encode(message.muteConfigs[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 ListMuteConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListMuteConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListMuteConfigsResponse} message ListMuteConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMuteConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMuteConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.muteConfigs && message.muteConfigs.length)) + message.muteConfigs = []; + message.muteConfigs.push($root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMuteConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMuteConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMuteConfigsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMuteConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.muteConfigs != null && message.hasOwnProperty("muteConfigs")) { + if (!Array.isArray(message.muteConfigs)) + return "muteConfigs: array expected"; + for (var i = 0; i < message.muteConfigs.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.MuteConfig.verify(message.muteConfigs[i]); + if (error) + return "muteConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMuteConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListMuteConfigsResponse} ListMuteConfigsResponse + */ + ListMuteConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListMuteConfigsResponse(); + if (object.muteConfigs) { + if (!Array.isArray(object.muteConfigs)) + throw TypeError(".google.cloud.securitycenter.v1.ListMuteConfigsResponse.muteConfigs: array expected"); + message.muteConfigs = []; + for (var i = 0; i < object.muteConfigs.length; ++i) { + if (typeof object.muteConfigs[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListMuteConfigsResponse.muteConfigs: object expected"); + message.muteConfigs[i] = $root.google.cloud.securitycenter.v1.MuteConfig.fromObject(object.muteConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMuteConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.ListMuteConfigsResponse} message ListMuteConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMuteConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.muteConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.muteConfigs && message.muteConfigs.length) { + object.muteConfigs = []; + for (var j = 0; j < message.muteConfigs.length; ++j) + object.muteConfigs[j] = $root.google.cloud.securitycenter.v1.MuteConfig.toObject(message.muteConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMuteConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListMuteConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMuteConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListMuteConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMuteConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListMuteConfigsResponse"; + }; + + return ListMuteConfigsResponse; + })(); + + v1.ListNotificationConfigsRequest = (function() { + + /** + * Properties of a ListNotificationConfigsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListNotificationConfigsRequest + * @property {string|null} [parent] ListNotificationConfigsRequest parent + * @property {string|null} [pageToken] ListNotificationConfigsRequest pageToken + * @property {number|null} [pageSize] ListNotificationConfigsRequest pageSize + */ + + /** + * Constructs a new ListNotificationConfigsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListNotificationConfigsRequest. + * @implements IListNotificationConfigsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest=} [properties] Properties to set + */ + function ListNotificationConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNotificationConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.parent = ""; + + /** + * ListNotificationConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.pageToken = ""; + + /** + * ListNotificationConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListNotificationConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} ListNotificationConfigsRequest instance + */ + ListNotificationConfigsRequest.create = function create(properties) { + return new ListNotificationConfigsRequest(properties); + }; + + /** + * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} message ListNotificationConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNotificationConfigsRequest.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 ListNotificationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsRequest} message ListNotificationConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNotificationConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} ListNotificationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest(); + 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 ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} ListNotificationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNotificationConfigsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNotificationConfigsRequest.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 ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} ListNotificationConfigsRequest + */ + ListNotificationConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListNotificationConfigsRequest(); + 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 ListNotificationConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1.ListNotificationConfigsRequest} message ListNotificationConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNotificationConfigsRequest.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 ListNotificationConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListNotificationConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListNotificationConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNotificationConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListNotificationConfigsRequest"; + }; + + return ListNotificationConfigsRequest; + })(); + + v1.ListNotificationConfigsResponse = (function() { + + /** + * Properties of a ListNotificationConfigsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListNotificationConfigsResponse + * @property {Array.|null} [notificationConfigs] ListNotificationConfigsResponse notificationConfigs + * @property {string|null} [nextPageToken] ListNotificationConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListNotificationConfigsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListNotificationConfigsResponse. + * @implements IListNotificationConfigsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsResponse=} [properties] Properties to set + */ + function ListNotificationConfigsResponse(properties) { + this.notificationConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNotificationConfigsResponse notificationConfigs. + * @member {Array.} notificationConfigs + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @instance + */ + ListNotificationConfigsResponse.prototype.notificationConfigs = $util.emptyArray; + + /** + * ListNotificationConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @instance + */ + ListNotificationConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListNotificationConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} ListNotificationConfigsResponse instance + */ + ListNotificationConfigsResponse.create = function create(properties) { + return new ListNotificationConfigsResponse(properties); + }; + + /** + * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsResponse} message ListNotificationConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNotificationConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notificationConfigs != null && message.notificationConfigs.length) + for (var i = 0; i < message.notificationConfigs.length; ++i) + $root.google.cloud.securitycenter.v1.NotificationConfig.encode(message.notificationConfigs[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 ListNotificationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListNotificationConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListNotificationConfigsResponse} message ListNotificationConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNotificationConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} ListNotificationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.notificationConfigs && message.notificationConfigs.length)) + message.notificationConfigs = []; + message.notificationConfigs.push($root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} ListNotificationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNotificationConfigsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNotificationConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notificationConfigs != null && message.hasOwnProperty("notificationConfigs")) { + if (!Array.isArray(message.notificationConfigs)) + return "notificationConfigs: array expected"; + for (var i = 0; i < message.notificationConfigs.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.NotificationConfig.verify(message.notificationConfigs[i]); + if (error) + return "notificationConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListNotificationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} ListNotificationConfigsResponse + */ + ListNotificationConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListNotificationConfigsResponse(); + if (object.notificationConfigs) { + if (!Array.isArray(object.notificationConfigs)) + throw TypeError(".google.cloud.securitycenter.v1.ListNotificationConfigsResponse.notificationConfigs: array expected"); + message.notificationConfigs = []; + for (var i = 0; i < object.notificationConfigs.length; ++i) { + if (typeof object.notificationConfigs[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListNotificationConfigsResponse.notificationConfigs: object expected"); + message.notificationConfigs[i] = $root.google.cloud.securitycenter.v1.NotificationConfig.fromObject(object.notificationConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1.ListNotificationConfigsResponse} message ListNotificationConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNotificationConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.notificationConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.notificationConfigs && message.notificationConfigs.length) { + object.notificationConfigs = []; + for (var j = 0; j < message.notificationConfigs.length; ++j) + object.notificationConfigs[j] = $root.google.cloud.securitycenter.v1.NotificationConfig.toObject(message.notificationConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListNotificationConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListNotificationConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListNotificationConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListNotificationConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNotificationConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListNotificationConfigsResponse"; + }; + + return ListNotificationConfigsResponse; + })(); + + v1.ListSourcesRequest = (function() { + + /** + * Properties of a ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListSourcesRequest + * @property {string|null} [parent] ListSourcesRequest parent + * @property {string|null} [pageToken] ListSourcesRequest pageToken + * @property {number|null} [pageSize] ListSourcesRequest pageSize + */ + + /** + * Constructs a new ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListSourcesRequest. + * @implements IListSourcesRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListSourcesRequest=} [properties] Properties to set + */ + function ListSourcesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.parent = ""; + + /** + * ListSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageToken = ""; + + /** + * ListSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest instance + */ + ListSourcesRequest.create = function create(properties) { + return new ListSourcesRequest(properties); + }; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.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 7, wireType 0 =*/56).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListSourcesRequest(); + 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 7: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesRequest.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 ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListSourcesRequest} ListSourcesRequest + */ + ListSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListSourcesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListSourcesRequest(); + 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 ListSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1.ListSourcesRequest} message ListSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesRequest.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 ListSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListSourcesRequest"; + }; + + return ListSourcesRequest; + })(); + + v1.ListSourcesResponse = (function() { + + /** + * Properties of a ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListSourcesResponse + * @property {Array.|null} [sources] ListSourcesResponse sources + * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken + */ + + /** + * Constructs a new ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListSourcesResponse. + * @implements IListSourcesResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListSourcesResponse=} [properties] Properties to set + */ + function ListSourcesResponse(properties) { + this.sources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSourcesResponse sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.sources = $util.emptyArray; + + /** + * ListSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse instance + */ + ListSourcesResponse.create = function create(properties) { + return new ListSourcesResponse(properties); + }; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.securitycenter.v1.Source.encode(message.sources[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 ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.sources[i]); + if (error) + return "sources." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListSourcesResponse} ListSourcesResponse + */ + ListSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListSourcesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListSourcesResponse(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v1.ListSourcesResponse.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListSourcesResponse.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v1.Source.fromObject(object.sources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1.ListSourcesResponse} message ListSourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sources = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v1.Source.toObject(message.sources[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListSourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListSourcesResponse"; + }; + + return ListSourcesResponse; + })(); + + v1.ListAssetsRequest = (function() { + + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {string|null} [filter] ListAssetsRequest filter + * @property {string|null} [orderBy] ListAssetsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask + * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {number|null} [pageSize] ListAssetsRequest pageSize + */ + + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; + + /** + * ListAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.filter = ""; + + /** + * ListAssetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.orderBy = ""; + + /** + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.readTime = null; + + /** + * ListAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.compareDuration = null; + + /** + * ListAssetsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.fieldMask = null; + + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListAssetsRequest(); + 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.orderBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 8: { + message.pageToken = reader.string(); + break; + } + case 9: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsRequest.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListAssetsRequest} ListAssetsRequest + */ + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + 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 ListAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsRequest} message ListAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + 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.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + 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 ListAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListAssetsRequest"; + }; + + return ListAssetsRequest; + })(); + + v1.ListAssetsResponse = (function() { + + /** + * Properties of a ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListAssetsResponse + * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + * @property {number|null} [totalSize] ListAssetsResponse totalSize + */ + + /** + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListAssetsResponse=} [properties] Properties to set + */ + function ListAssetsResponse(properties) { + this.listAssetsResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssetsResponse listAssetsResults. + * @member {Array.} listAssetsResults + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; + + /** + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.readTime = null; + + /** + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.nextPageToken = ""; + + /** + * ListAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse instance + */ + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); + }; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listAssetsResults != null && message.listAssetsResults.length) + for (var i = 0; i < message.listAssetsResults.length; ++i) + $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.listAssetsResults && message.listAssetsResults.length)) + message.listAssetsResults = []; + message.listAssetsResults.push($root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { + if (!Array.isArray(message.listAssetsResults)) + return "listAssetsResults: array expected"; + for (var i = 0; i < message.listAssetsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); + if (error) + return "listAssetsResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse} ListAssetsResponse + */ + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse(); + if (object.listAssetsResults) { + if (!Array.isArray(object.listAssetsResults)) + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.listAssetsResults: array expected"); + message.listAssetsResults = []; + for (var i = 0; i < object.listAssetsResults.length; ++i) { + if (typeof object.listAssetsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.listAssetsResults: object expected"); + message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse} message ListAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listAssetsResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.listAssetsResults && message.listAssetsResults.length) { + object.listAssetsResults = []; + for (var j = 0; j < message.listAssetsResults.length; ++j) + object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListAssetsResponse"; + }; + + ListAssetsResponse.ListAssetsResult = (function() { + + /** + * Properties of a ListAssetsResult. + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @interface IListAssetsResult + * @property {google.cloud.securitycenter.v1.IAsset|null} [asset] ListAssetsResult asset + * @property {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange|null} [stateChange] ListAssetsResult stateChange + */ + + /** + * Constructs a new ListAssetsResult. + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse + * @classdesc Represents a ListAssetsResult. + * @implements IListAssetsResult + * @constructor + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + */ + function ListAssetsResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssetsResult asset. + * @member {google.cloud.securitycenter.v1.IAsset|null|undefined} asset + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.asset = null; + + /** + * ListAssetsResult stateChange. + * @member {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange} stateChange + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.stateChange = 0; + + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance + */ + ListAssetsResult.create = function create(properties) { + return new ListAssetsResult(properties); + }; + + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + $root.google.cloud.securitycenter.v1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateChange != null && Object.hasOwnProperty.call(message, "stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); + return writer; + }; + + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.asset = $root.google.cloud.securitycenter.v1.Asset.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stateChange = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.securitycenter.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + switch (message.stateChange) { + default: + return "stateChange: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + */ + ListAssetsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.asset: object expected"); + message.asset = $root.google.cloud.securitycenter.v1.Asset.fromObject(object.asset); + } + switch (object.stateChange) { + default: + if (typeof object.stateChange === "number") { + message.stateChange = object.stateChange; + break; + } + break; + case "UNUSED": + case 0: + message.stateChange = 0; + break; + case "ADDED": + case 1: + message.stateChange = 1; + break; + case "REMOVED": + case 2: + message.stateChange = 2; + break; + case "ACTIVE": + case 3: + message.stateChange = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.asset = null; + object.stateChange = options.enums === String ? "UNUSED" : 0; + } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.securitycenter.v1.Asset.toObject(message.asset, options); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] === undefined ? message.stateChange : $root.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; + return object; + }; + + /** + * Converts this ListAssetsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult"; + }; + + /** + * StateChange enum. + * @name google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + * @enum {number} + * @property {number} UNUSED=0 UNUSED value + * @property {number} ADDED=1 ADDED value + * @property {number} REMOVED=2 REMOVED value + * @property {number} ACTIVE=3 ACTIVE value + */ + ListAssetsResult.StateChange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNUSED"] = 0; + values[valuesById[1] = "ADDED"] = 1; + values[valuesById[2] = "REMOVED"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + return values; + })(); + + return ListAssetsResult; + })(); + + return ListAssetsResponse; + })(); + + v1.ListFindingsRequest = (function() { + + /** + * Properties of a ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [orderBy] ListFindingsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListFindingsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask + * @property {string|null} [pageToken] ListFindingsRequest pageToken + * @property {number|null} [pageSize] ListFindingsRequest pageSize + */ + + /** + * Constructs a new ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.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.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.parent = ""; + + /** + * ListFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.filter = ""; + + /** + * ListFindingsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.orderBy = ""; + + /** + * ListFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.readTime = null; + + /** + * ListFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.compareDuration = null; + + /** + * ListFindingsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.fieldMask = null; + + /** + * ListFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageToken = ""; + + /** + * ListFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest instance + */ + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); + }; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.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.securitycenter.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.securitycenter.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.securitycenter.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.orderBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 8: { + message.pageToken = reader.string(); + break; + } + case 9: { + 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.securitycenter.v1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.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.securitycenter.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + 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.securitycenter.v1.ListFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListFindingsRequest} ListFindingsRequest + */ + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + 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.securitycenter.v1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.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.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + 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.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + 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.securitycenter.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.securitycenter.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.securitycenter.v1.ListFindingsRequest"; + }; + + return ListFindingsRequest; + })(); + + v1.ListFindingsResponse = (function() { + + /** + * Properties of a ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListFindingsResponse + * @property {Array.|null} [listFindingsResults] ListFindingsResponse listFindingsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + * @property {number|null} [totalSize] ListFindingsResponse totalSize + */ + + /** + * Constructs a new ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListFindingsResponse=} [properties] Properties to set + */ + function ListFindingsResponse(properties) { + this.listFindingsResults = []; + if (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 listFindingsResults. + * @member {Array.} listFindingsResults + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.listFindingsResults = $util.emptyArray; + + /** + * ListFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.readTime = null; + + /** + * ListFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.nextPageToken = ""; + + /** + * ListFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse instance + */ + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); + }; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.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.listFindingsResults != null && message.listFindingsResults.length) + for (var i = 0; i < message.listFindingsResults.length; ++i) + $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.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.securitycenter.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.securitycenter.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.securitycenter.v1.ListFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.listFindingsResults && message.listFindingsResults.length)) + message.listFindingsResults = []; + message.listFindingsResults.push($root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + 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.securitycenter.v1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.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.securitycenter.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.listFindingsResults != null && message.hasOwnProperty("listFindingsResults")) { + if (!Array.isArray(message.listFindingsResults)) + return "listFindingsResults: array expected"; + for (var i = 0; i < message.listFindingsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify(message.listFindingsResults[i]); + if (error) + return "listFindingsResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse} ListFindingsResponse + */ + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse(); + if (object.listFindingsResults) { + if (!Array.isArray(object.listFindingsResults)) + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.listFindingsResults: array expected"); + message.listFindingsResults = []; + for (var i = 0; i < object.listFindingsResults.length; ++i) { + if (typeof object.listFindingsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.listFindingsResults: object expected"); + message.listFindingsResults[i] = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.fromObject(object.listFindingsResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.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.listFindingsResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.listFindingsResults && message.listFindingsResults.length) { + object.listFindingsResults = []; + for (var j = 0; j < message.listFindingsResults.length; ++j) + object.listFindingsResults[j] = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.toObject(message.listFindingsResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.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.securitycenter.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.securitycenter.v1.ListFindingsResponse"; + }; + + ListFindingsResponse.ListFindingsResult = (function() { + + /** + * Properties of a ListFindingsResult. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @interface IListFindingsResult + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] ListFindingsResult finding + * @property {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange|null} [stateChange] ListFindingsResult stateChange + * @property {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null} [resource] ListFindingsResult resource + */ + + /** + * Constructs a new ListFindingsResult. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse + * @classdesc Represents a ListFindingsResult. + * @implements IListFindingsResult + * @constructor + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set + */ + function ListFindingsResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingsResult finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.finding = null; + + /** + * ListFindingsResult stateChange. + * @member {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange} stateChange + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.stateChange = 0; + + /** + * ListFindingsResult resource. + * @member {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.resource = null; + + /** + * Creates a new ListFindingsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult instance + */ + ListFindingsResult.create = function create(properties) { + return new ListFindingsResult(properties); + }; + + /** + * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateChange != null && Object.hasOwnProperty.call(message, "stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stateChange = reader.int32(); + break; + } + case 3: { + message.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + switch (message.stateChange) { + default: + return "stateChange: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a ListFindingsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + */ + ListFindingsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + switch (object.stateChange) { + default: + if (typeof object.stateChange === "number") { + message.stateChange = object.stateChange; + break; + } + break; + case "UNUSED": + case 0: + message.stateChange = 0; + break; + case "CHANGED": + case 1: + message.stateChange = 1; + break; + case "UNCHANGED": + case 2: + message.stateChange = 2; + break; + case "ADDED": + case 3: + message.stateChange = 3; + break; + case "REMOVED": + case 4: + message.stateChange = 4; + break; + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} message ListFindingsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finding = null; + object.stateChange = options.enums === String ? "UNUSED" : 0; + object.resource = null; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] === undefined ? message.stateChange : $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] : message.stateChange; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.toObject(message.resource, options); + return object; + }; + + /** + * Converts this ListFindingsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingsResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult"; + }; + + /** + * StateChange enum. + * @name google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + * @enum {number} + * @property {number} UNUSED=0 UNUSED value + * @property {number} CHANGED=1 CHANGED value + * @property {number} UNCHANGED=2 UNCHANGED value + * @property {number} ADDED=3 ADDED value + * @property {number} REMOVED=4 REMOVED value + */ + ListFindingsResult.StateChange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNUSED"] = 0; + values[valuesById[1] = "CHANGED"] = 1; + values[valuesById[2] = "UNCHANGED"] = 2; + values[valuesById[3] = "ADDED"] = 3; + values[valuesById[4] = "REMOVED"] = 4; + return values; + })(); + + ListFindingsResult.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @interface IResource + * @property {string|null} [name] Resource name + * @property {string|null} [displayName] Resource displayName + * @property {string|null} [type] Resource type + * @property {string|null} [projectName] Resource projectName + * @property {string|null} [projectDisplayName] Resource projectDisplayName + * @property {string|null} [parentName] Resource parentName + * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {Array.|null} [folders] Resource folders + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set + */ + function Resource(properties) { + this.folders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.name = ""; + + /** + * Resource displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.displayName = ""; + + /** + * Resource type. + * @member {string} type + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.type = ""; + + /** + * Resource projectName. + * @member {string} projectName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.projectName = ""; + + /** + * Resource projectDisplayName. + * @member {string} projectDisplayName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.projectDisplayName = ""; + + /** + * Resource parentName. + * @member {string} parentName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.parentName = ""; + + /** + * Resource parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.parentDisplayName = ""; + + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.projectName != null && Object.hasOwnProperty.call(message, "projectName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectName); + if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); + if (message.parentName != null && Object.hasOwnProperty.call(message, "parentName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentName); + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.type); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 8: { + message.displayName = reader.string(); + break; + } + case 6: { + message.type = reader.string(); + break; + } + case 2: { + message.projectName = reader.string(); + break; + } + case 3: { + message.projectDisplayName = reader.string(); + break; + } + case 4: { + message.parentName = reader.string(); + break; + } + case 5: { + message.parentDisplayName = reader.string(); + break; + } + case 7: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1.Folder.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.projectName != null && message.hasOwnProperty("projectName")) + if (!$util.isString(message.projectName)) + return "projectName: string expected"; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + if (!$util.isString(message.projectDisplayName)) + return "projectDisplayName: string expected"; + if (message.parentName != null && message.hasOwnProperty("parentName")) + if (!$util.isString(message.parentName)) + return "parentName: string expected"; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (!$util.isString(message.parentDisplayName)) + return "parentDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.type != null) + message.type = String(object.type); + if (object.projectName != null) + message.projectName = String(object.projectName); + if (object.projectDisplayName != null) + message.projectDisplayName = String(object.projectDisplayName); + if (object.parentName != null) + message.parentName = String(object.parentName); + if (object.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1.Folder.fromObject(object.folders[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.folders = []; + if (options.defaults) { + object.name = ""; + object.projectName = ""; + object.projectDisplayName = ""; + object.parentName = ""; + object.parentDisplayName = ""; + object.type = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.projectName != null && message.hasOwnProperty("projectName")) + object.projectName = message.projectName; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + object.projectDisplayName = message.projectDisplayName; + if (message.parentName != null && message.hasOwnProperty("parentName")) + object.parentName = message.parentName; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + object.parentDisplayName = message.parentDisplayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1.Folder.toObject(message.folders[j], options); + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource"; + }; + + return Resource; + })(); + + return ListFindingsResult; + })(); + + return ListFindingsResponse; + })(); + + v1.SetFindingStateRequest = (function() { + + /** + * Properties of a SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ISetFindingStateRequest + * @property {string|null} [name] SetFindingStateRequest name + * @property {google.cloud.securitycenter.v1.Finding.State|null} [state] SetFindingStateRequest state + * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + */ + + /** + * Constructs a new SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + */ + function SetFindingStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetFindingStateRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.name = ""; + + /** + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v1.Finding.State} state + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.state = 0; + + /** + * SetFindingStateRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.startTime = null; + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest instance + */ + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); + }; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetFindingStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetFindingStateRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetFindingStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SetFindingStateRequest} SetFindingStateRequest + */ + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SetFindingStateRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.SetFindingStateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.SetFindingStateRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1.SetFindingStateRequest} message SetFindingStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetFindingStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1.Finding.State[message.state] : message.state; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @instance + * @returns {Object.} JSON object + */ + SetFindingStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetFindingStateRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SetFindingStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetFindingStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SetFindingStateRequest"; + }; + + return SetFindingStateRequest; + })(); + + v1.SetMuteRequest = (function() { + + /** + * Properties of a SetMuteRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ISetMuteRequest + * @property {string|null} [name] SetMuteRequest name + * @property {google.cloud.securitycenter.v1.Finding.Mute|null} [mute] SetMuteRequest mute + */ + + /** + * Constructs a new SetMuteRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a SetMuteRequest. + * @implements ISetMuteRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ISetMuteRequest=} [properties] Properties to set + */ + function SetMuteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetMuteRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @instance + */ + SetMuteRequest.prototype.name = ""; + + /** + * SetMuteRequest mute. + * @member {google.cloud.securitycenter.v1.Finding.Mute} mute + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @instance + */ + SetMuteRequest.prototype.mute = 0; + + /** + * Creates a new SetMuteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetMuteRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest instance + */ + SetMuteRequest.create = function create(properties) { + return new SetMuteRequest(properties); + }; + + /** + * Encodes the specified SetMuteRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetMuteRequest} message SetMuteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetMuteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.mute != null && Object.hasOwnProperty.call(message, "mute")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mute); + return writer; + }; + + /** + * Encodes the specified SetMuteRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.SetMuteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {google.cloud.securitycenter.v1.ISetMuteRequest} message SetMuteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetMuteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetMuteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetMuteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.SetMuteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.mute = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetMuteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetMuteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetMuteRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetMuteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.mute != null && message.hasOwnProperty("mute")) + switch (message.mute) { + default: + return "mute: enum value expected"; + case 0: + case 1: + case 2: + case 4: + break; + } + return null; + }; + + /** + * Creates a SetMuteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.SetMuteRequest} SetMuteRequest + */ + SetMuteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.SetMuteRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.SetMuteRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.mute) { + default: + if (typeof object.mute === "number") { + message.mute = object.mute; + break; + } + break; + case "MUTE_UNSPECIFIED": + case 0: + message.mute = 0; + break; + case "MUTED": + case 1: + message.mute = 1; + break; + case "UNMUTED": + case 2: + message.mute = 2; + break; + case "UNDEFINED": + case 4: + message.mute = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a SetMuteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {google.cloud.securitycenter.v1.SetMuteRequest} message SetMuteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetMuteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.mute = options.enums === String ? "MUTE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.mute != null && message.hasOwnProperty("mute")) + object.mute = options.enums === String ? $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] === undefined ? message.mute : $root.google.cloud.securitycenter.v1.Finding.Mute[message.mute] : message.mute; + return object; + }; + + /** + * Converts this SetMuteRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @instance + * @returns {Object.} JSON object + */ + SetMuteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetMuteRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.SetMuteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetMuteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.SetMuteRequest"; + }; + + return SetMuteRequest; + })(); + + v1.RunAssetDiscoveryRequest = (function() { + + /** + * Properties of a RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IRunAssetDiscoveryRequest + * @property {string|null} [parent] RunAssetDiscoveryRequest parent + */ + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a RunAssetDiscoveryRequest. + * @implements IRunAssetDiscoveryRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest=} [properties] Properties to set + */ + function RunAssetDiscoveryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunAssetDiscoveryRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @instance + */ + RunAssetDiscoveryRequest.prototype.parent = ""; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance + */ + RunAssetDiscoveryRequest.create = function create(properties) { + return new RunAssetDiscoveryRequest(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.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 RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest(); + 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 RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryRequest.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 RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + */ + RunAssetDiscoveryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryRequest.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 RunAssetDiscoveryRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunAssetDiscoveryRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAssetDiscoveryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.RunAssetDiscoveryRequest"; + }; + + return RunAssetDiscoveryRequest; + })(); + + v1.UpdateExternalSystemRequest = (function() { + + /** + * Properties of an UpdateExternalSystemRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateExternalSystemRequest + * @property {google.cloud.securitycenter.v1.IExternalSystem|null} [externalSystem] UpdateExternalSystemRequest externalSystem + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExternalSystemRequest updateMask + */ + + /** + * Constructs a new UpdateExternalSystemRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateExternalSystemRequest. + * @implements IUpdateExternalSystemRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateExternalSystemRequest=} [properties] Properties to set + */ + function UpdateExternalSystemRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateExternalSystemRequest externalSystem. + * @member {google.cloud.securitycenter.v1.IExternalSystem|null|undefined} externalSystem + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @instance + */ + UpdateExternalSystemRequest.prototype.externalSystem = null; + + /** + * UpdateExternalSystemRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @instance + */ + UpdateExternalSystemRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateExternalSystemRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateExternalSystemRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateExternalSystemRequest} UpdateExternalSystemRequest instance + */ + UpdateExternalSystemRequest.create = function create(properties) { + return new UpdateExternalSystemRequest(properties); + }; + + /** + * Encodes the specified UpdateExternalSystemRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateExternalSystemRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateExternalSystemRequest} message UpdateExternalSystemRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExternalSystemRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.externalSystem != null && Object.hasOwnProperty.call(message, "externalSystem")) + $root.google.cloud.securitycenter.v1.ExternalSystem.encode(message.externalSystem, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateExternalSystemRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateExternalSystemRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateExternalSystemRequest} message UpdateExternalSystemRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExternalSystemRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExternalSystemRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateExternalSystemRequest} UpdateExternalSystemRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExternalSystemRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateExternalSystemRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.externalSystem = $root.google.cloud.securitycenter.v1.ExternalSystem.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExternalSystemRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateExternalSystemRequest} UpdateExternalSystemRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExternalSystemRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExternalSystemRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExternalSystemRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.externalSystem != null && message.hasOwnProperty("externalSystem")) { + var error = $root.google.cloud.securitycenter.v1.ExternalSystem.verify(message.externalSystem); + if (error) + return "externalSystem." + 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 UpdateExternalSystemRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateExternalSystemRequest} UpdateExternalSystemRequest + */ + UpdateExternalSystemRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateExternalSystemRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateExternalSystemRequest(); + if (object.externalSystem != null) { + if (typeof object.externalSystem !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateExternalSystemRequest.externalSystem: object expected"); + message.externalSystem = $root.google.cloud.securitycenter.v1.ExternalSystem.fromObject(object.externalSystem); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateExternalSystemRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExternalSystemRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateExternalSystemRequest} message UpdateExternalSystemRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExternalSystemRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.externalSystem = null; + object.updateMask = null; + } + if (message.externalSystem != null && message.hasOwnProperty("externalSystem")) + object.externalSystem = $root.google.cloud.securitycenter.v1.ExternalSystem.toObject(message.externalSystem, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateExternalSystemRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExternalSystemRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExternalSystemRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateExternalSystemRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExternalSystemRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateExternalSystemRequest"; + }; + + return UpdateExternalSystemRequest; + })(); + + v1.UpdateFindingRequest = (function() { + + /** + * Properties of an UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateFindingRequest + * @property {google.cloud.securitycenter.v1.IFinding|null} [finding] UpdateFindingRequest finding + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask + */ + + /** + * Constructs a new UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateFindingRequest. + * @implements IUpdateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest=} [properties] Properties to set + */ + function UpdateFindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateFindingRequest finding. + * @member {google.cloud.securitycenter.v1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.finding = null; + + /** + * UpdateFindingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest instance + */ + UpdateFindingRequest.create = function create(properties) { + return new UpdateFindingRequest(properties); + }; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.finding = $root.google.cloud.securitycenter.v1.Finding.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1.Finding.verify(message.finding); + if (error) + return "finding." + 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 UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateFindingRequest} UpdateFindingRequest + */ + UpdateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateFindingRequest(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1.Finding.fromObject(object.finding); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateFindingRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateFindingRequest} message UpdateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finding = null; + object.updateMask = null; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1.Finding.toObject(message.finding, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateFindingRequest"; + }; + + return UpdateFindingRequest; + })(); + + v1.UpdateMuteConfigRequest = (function() { + + /** + * Properties of an UpdateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateMuteConfigRequest + * @property {google.cloud.securitycenter.v1.IMuteConfig|null} [muteConfig] UpdateMuteConfigRequest muteConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMuteConfigRequest updateMask + */ + + /** + * Constructs a new UpdateMuteConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateMuteConfigRequest. + * @implements IUpdateMuteConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest=} [properties] Properties to set + */ + function UpdateMuteConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMuteConfigRequest muteConfig. + * @member {google.cloud.securitycenter.v1.IMuteConfig|null|undefined} muteConfig + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @instance + */ + UpdateMuteConfigRequest.prototype.muteConfig = null; + + /** + * UpdateMuteConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @instance + */ + UpdateMuteConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateMuteConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} UpdateMuteConfigRequest instance + */ + UpdateMuteConfigRequest.create = function create(properties) { + return new UpdateMuteConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateMuteConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateMuteConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest} message UpdateMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMuteConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.muteConfig != null && Object.hasOwnProperty.call(message, "muteConfig")) + $root.google.cloud.securitycenter.v1.MuteConfig.encode(message.muteConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateMuteConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateMuteConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateMuteConfigRequest} message UpdateMuteConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMuteConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMuteConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} UpdateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMuteConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateMuteConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMuteConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} UpdateMuteConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMuteConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMuteConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMuteConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) { + var error = $root.google.cloud.securitycenter.v1.MuteConfig.verify(message.muteConfig); + if (error) + return "muteConfig." + 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 UpdateMuteConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} UpdateMuteConfigRequest + */ + UpdateMuteConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateMuteConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateMuteConfigRequest(); + if (object.muteConfig != null) { + if (typeof object.muteConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateMuteConfigRequest.muteConfig: object expected"); + message.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.fromObject(object.muteConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateMuteConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateMuteConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateMuteConfigRequest} message UpdateMuteConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMuteConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.muteConfig = null; + object.updateMask = null; + } + if (message.muteConfig != null && message.hasOwnProperty("muteConfig")) + object.muteConfig = $root.google.cloud.securitycenter.v1.MuteConfig.toObject(message.muteConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateMuteConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMuteConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMuteConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateMuteConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMuteConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateMuteConfigRequest"; + }; + + return UpdateMuteConfigRequest; + })(); + + v1.UpdateNotificationConfigRequest = (function() { + + /** + * Properties of an UpdateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateNotificationConfigRequest + * @property {google.cloud.securitycenter.v1.INotificationConfig|null} [notificationConfig] UpdateNotificationConfigRequest notificationConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateNotificationConfigRequest updateMask + */ + + /** + * Constructs a new UpdateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateNotificationConfigRequest. + * @implements IUpdateNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest=} [properties] Properties to set + */ + function UpdateNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateNotificationConfigRequest notificationConfig. + * @member {google.cloud.securitycenter.v1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @instance + */ + UpdateNotificationConfigRequest.prototype.notificationConfig = null; + + /** + * UpdateNotificationConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @instance + */ + UpdateNotificationConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest instance + */ + UpdateNotificationConfigRequest.create = function create(properties) { + return new UpdateNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} message UpdateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateNotificationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.cloud.securitycenter.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest} message UpdateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateNotificationConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateNotificationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.securitycenter.v1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + 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 UpdateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest + */ + UpdateNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest(); + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.fromObject(object.notificationConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateNotificationConfigRequest} message UpdateNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateNotificationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.notificationConfig = null; + object.updateMask = null; + } + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.securitycenter.v1.NotificationConfig.toObject(message.notificationConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateNotificationConfigRequest"; + }; + + return UpdateNotificationConfigRequest; + })(); + + v1.UpdateOrganizationSettingsRequest = (function() { + + /** + * Properties of an UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateOrganizationSettingsRequest + * @property {google.cloud.securitycenter.v1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask + */ + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateOrganizationSettingsRequest. + * @implements IUpdateOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + */ + function UpdateOrganizationSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateOrganizationSettingsRequest organizationSettings. + * @member {google.cloud.securitycenter.v1.IOrganizationSettings|null|undefined} organizationSettings + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; + + /** + * UpdateOrganizationSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance + */ + UpdateOrganizationSettingsRequest.create = function create(properties) { + return new UpdateOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organizationSettings != null && Object.hasOwnProperty.call(message, "organizationSettings")) + $root.google.cloud.securitycenter.v1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateOrganizationSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { + var error = $root.google.cloud.securitycenter.v1.OrganizationSettings.verify(message.organizationSettings); + if (error) + return "organizationSettings." + 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 UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + */ + UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(); + if (object.organizationSettings != null) { + if (typeof object.organizationSettings !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); + message.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.fromObject(object.organizationSettings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.organizationSettings = null; + object.updateMask = null; + } + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + object.organizationSettings = $root.google.cloud.securitycenter.v1.OrganizationSettings.toObject(message.organizationSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateOrganizationSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateOrganizationSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest"; + }; + + return UpdateOrganizationSettingsRequest; + })(); + + v1.UpdateSourceRequest = (function() { + + /** + * Properties of an UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateSourceRequest + * @property {google.cloud.securitycenter.v1.ISource|null} [source] UpdateSourceRequest source + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + */ + + /** + * Constructs a new UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateSourceRequest. + * @implements IUpdateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest=} [properties] Properties to set + */ + function UpdateSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSourceRequest source. + * @member {google.cloud.securitycenter.v1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.source = null; + + /** + * UpdateSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest instance + */ + UpdateSourceRequest.create = function create(properties) { + return new UpdateSourceRequest(properties); + }; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.securitycenter.v1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.securitycenter.v1.Source.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1.Source.verify(message.source); + if (error) + return "source." + 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 UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateSourceRequest} UpdateSourceRequest + */ + UpdateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateSourceRequest(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1.Source.fromObject(object.source); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateSourceRequest} message UpdateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.updateMask = null; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1.Source.toObject(message.source, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateSourceRequest"; + }; + + return UpdateSourceRequest; + })(); + + v1.UpdateSecurityMarksRequest = (function() { + + /** + * Properties of an UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateSecurityMarksRequest + * @property {google.cloud.securitycenter.v1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime + */ + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateSecurityMarksRequest. + * @implements IUpdateSecurityMarksRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest=} [properties] Properties to set + */ + function UpdateSecurityMarksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSecurityMarksRequest securityMarks. + * @member {google.cloud.securitycenter.v1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.securityMarks = null; + + /** + * UpdateSecurityMarksRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.updateMask = null; + + /** + * UpdateSecurityMarksRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.startTime = null; + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance + */ + UpdateSecurityMarksRequest.create = function create(properties) { + return new UpdateSecurityMarksRequest(properties); + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) + $root.google.cloud.securitycenter.v1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSecurityMarksRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSecurityMarksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + */ + UpdateSecurityMarksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest(); + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSecurityMarksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityMarks = null; + object.updateMask = null; + object.startTime = null; + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1.SecurityMarks.toObject(message.securityMarks, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSecurityMarksRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSecurityMarksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateSecurityMarksRequest"; + }; + + return UpdateSecurityMarksRequest; + })(); + + v1.CreateBigQueryExportRequest = (function() { + + /** + * Properties of a CreateBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface ICreateBigQueryExportRequest + * @property {string|null} [parent] CreateBigQueryExportRequest parent + * @property {google.cloud.securitycenter.v1.IBigQueryExport|null} [bigQueryExport] CreateBigQueryExportRequest bigQueryExport + * @property {string|null} [bigQueryExportId] CreateBigQueryExportRequest bigQueryExportId + */ + + /** + * Constructs a new CreateBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a CreateBigQueryExportRequest. + * @implements ICreateBigQueryExportRequest + * @constructor + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest=} [properties] Properties to set + */ + function CreateBigQueryExportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBigQueryExportRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @instance + */ + CreateBigQueryExportRequest.prototype.parent = ""; + + /** + * CreateBigQueryExportRequest bigQueryExport. + * @member {google.cloud.securitycenter.v1.IBigQueryExport|null|undefined} bigQueryExport + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @instance + */ + CreateBigQueryExportRequest.prototype.bigQueryExport = null; + + /** + * CreateBigQueryExportRequest bigQueryExportId. + * @member {string} bigQueryExportId + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @instance + */ + CreateBigQueryExportRequest.prototype.bigQueryExportId = ""; + + /** + * Creates a new CreateBigQueryExportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} CreateBigQueryExportRequest instance + */ + CreateBigQueryExportRequest.create = function create(properties) { + return new CreateBigQueryExportRequest(properties); + }; + + /** + * Encodes the specified CreateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.CreateBigQueryExportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest} message CreateBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBigQueryExportRequest.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.bigQueryExport != null && Object.hasOwnProperty.call(message, "bigQueryExport")) + $root.google.cloud.securitycenter.v1.BigQueryExport.encode(message.bigQueryExport, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigQueryExportId != null && Object.hasOwnProperty.call(message, "bigQueryExportId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.bigQueryExportId); + return writer; + }; + + /** + * Encodes the specified CreateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.CreateBigQueryExportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.ICreateBigQueryExportRequest} message CreateBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} CreateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBigQueryExportRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.CreateBigQueryExportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.decode(reader, reader.uint32()); + break; + } + case 3: { + message.bigQueryExportId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} CreateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBigQueryExportRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBigQueryExportRequest.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.bigQueryExport != null && message.hasOwnProperty("bigQueryExport")) { + var error = $root.google.cloud.securitycenter.v1.BigQueryExport.verify(message.bigQueryExport); + if (error) + return "bigQueryExport." + error; + } + if (message.bigQueryExportId != null && message.hasOwnProperty("bigQueryExportId")) + if (!$util.isString(message.bigQueryExportId)) + return "bigQueryExportId: string expected"; + return null; + }; + + /** + * Creates a CreateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} CreateBigQueryExportRequest + */ + CreateBigQueryExportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.CreateBigQueryExportRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.CreateBigQueryExportRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.bigQueryExport != null) { + if (typeof object.bigQueryExport !== "object") + throw TypeError(".google.cloud.securitycenter.v1.CreateBigQueryExportRequest.bigQueryExport: object expected"); + message.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.fromObject(object.bigQueryExport); + } + if (object.bigQueryExportId != null) + message.bigQueryExportId = String(object.bigQueryExportId); + return message; + }; + + /** + * Creates a plain object from a CreateBigQueryExportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.CreateBigQueryExportRequest} message CreateBigQueryExportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBigQueryExportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.bigQueryExport = null; + object.bigQueryExportId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.bigQueryExport != null && message.hasOwnProperty("bigQueryExport")) + object.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.toObject(message.bigQueryExport, options); + if (message.bigQueryExportId != null && message.hasOwnProperty("bigQueryExportId")) + object.bigQueryExportId = message.bigQueryExportId; + return object; + }; + + /** + * Converts this CreateBigQueryExportRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBigQueryExportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBigQueryExportRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.CreateBigQueryExportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBigQueryExportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.CreateBigQueryExportRequest"; + }; + + return CreateBigQueryExportRequest; + })(); + + v1.UpdateBigQueryExportRequest = (function() { + + /** + * Properties of an UpdateBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IUpdateBigQueryExportRequest + * @property {google.cloud.securitycenter.v1.IBigQueryExport|null} [bigQueryExport] UpdateBigQueryExportRequest bigQueryExport + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBigQueryExportRequest updateMask + */ + + /** + * Constructs a new UpdateBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents an UpdateBigQueryExportRequest. + * @implements IUpdateBigQueryExportRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest=} [properties] Properties to set + */ + function UpdateBigQueryExportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBigQueryExportRequest bigQueryExport. + * @member {google.cloud.securitycenter.v1.IBigQueryExport|null|undefined} bigQueryExport + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @instance + */ + UpdateBigQueryExportRequest.prototype.bigQueryExport = null; + + /** + * UpdateBigQueryExportRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @instance + */ + UpdateBigQueryExportRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBigQueryExportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest instance + */ + UpdateBigQueryExportRequest.create = function create(properties) { + return new UpdateBigQueryExportRequest(properties); + }; + + /** + * Encodes the specified UpdateBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest} message UpdateBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBigQueryExportRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigQueryExport != null && Object.hasOwnProperty.call(message, "bigQueryExport")) + $root.google.cloud.securitycenter.v1.BigQueryExport.encode(message.bigQueryExport, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest} message UpdateBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBigQueryExportRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBigQueryExportRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBigQueryExportRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bigQueryExport != null && message.hasOwnProperty("bigQueryExport")) { + var error = $root.google.cloud.securitycenter.v1.BigQueryExport.verify(message.bigQueryExport); + if (error) + return "bigQueryExport." + 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 UpdateBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.UpdateBigQueryExportRequest} UpdateBigQueryExportRequest + */ + UpdateBigQueryExportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest(); + if (object.bigQueryExport != null) { + if (typeof object.bigQueryExport !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.bigQueryExport: object expected"); + message.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.fromObject(object.bigQueryExport); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1.UpdateBigQueryExportRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBigQueryExportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.UpdateBigQueryExportRequest} message UpdateBigQueryExportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBigQueryExportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bigQueryExport = null; + object.updateMask = null; + } + if (message.bigQueryExport != null && message.hasOwnProperty("bigQueryExport")) + object.bigQueryExport = $root.google.cloud.securitycenter.v1.BigQueryExport.toObject(message.bigQueryExport, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBigQueryExportRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBigQueryExportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBigQueryExportRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.UpdateBigQueryExportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBigQueryExportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.UpdateBigQueryExportRequest"; + }; + + return UpdateBigQueryExportRequest; + })(); + + v1.ListBigQueryExportsRequest = (function() { + + /** + * Properties of a ListBigQueryExportsRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IListBigQueryExportsRequest + * @property {string|null} [parent] ListBigQueryExportsRequest parent + * @property {number|null} [pageSize] ListBigQueryExportsRequest pageSize + * @property {string|null} [pageToken] ListBigQueryExportsRequest pageToken + */ + + /** + * Constructs a new ListBigQueryExportsRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListBigQueryExportsRequest. + * @implements IListBigQueryExportsRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsRequest=} [properties] Properties to set + */ + function ListBigQueryExportsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBigQueryExportsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @instance + */ + ListBigQueryExportsRequest.prototype.parent = ""; + + /** + * ListBigQueryExportsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @instance + */ + ListBigQueryExportsRequest.prototype.pageSize = 0; + + /** + * ListBigQueryExportsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @instance + */ + ListBigQueryExportsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBigQueryExportsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsRequest} ListBigQueryExportsRequest instance + */ + ListBigQueryExportsRequest.create = function create(properties) { + return new ListBigQueryExportsRequest(properties); + }; + + /** + * Encodes the specified ListBigQueryExportsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsRequest} message ListBigQueryExportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBigQueryExportsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListBigQueryExportsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsRequest} message ListBigQueryExportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBigQueryExportsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBigQueryExportsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsRequest} ListBigQueryExportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBigQueryExportsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListBigQueryExportsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBigQueryExportsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsRequest} ListBigQueryExportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBigQueryExportsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBigQueryExportsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBigQueryExportsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListBigQueryExportsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsRequest} ListBigQueryExportsRequest + */ + ListBigQueryExportsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListBigQueryExportsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListBigQueryExportsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListBigQueryExportsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {google.cloud.securitycenter.v1.ListBigQueryExportsRequest} message ListBigQueryExportsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBigQueryExportsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListBigQueryExportsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBigQueryExportsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBigQueryExportsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBigQueryExportsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListBigQueryExportsRequest"; + }; + + return ListBigQueryExportsRequest; + })(); + + v1.ListBigQueryExportsResponse = (function() { + + /** + * Properties of a ListBigQueryExportsResponse. + * @memberof google.cloud.securitycenter.v1 + * @interface IListBigQueryExportsResponse + * @property {Array.|null} [bigQueryExports] ListBigQueryExportsResponse bigQueryExports + * @property {string|null} [nextPageToken] ListBigQueryExportsResponse nextPageToken + */ + + /** + * Constructs a new ListBigQueryExportsResponse. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ListBigQueryExportsResponse. + * @implements IListBigQueryExportsResponse + * @constructor + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsResponse=} [properties] Properties to set + */ + function ListBigQueryExportsResponse(properties) { + this.bigQueryExports = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBigQueryExportsResponse bigQueryExports. + * @member {Array.} bigQueryExports + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @instance + */ + ListBigQueryExportsResponse.prototype.bigQueryExports = $util.emptyArray; + + /** + * ListBigQueryExportsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @instance + */ + ListBigQueryExportsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBigQueryExportsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsResponse} ListBigQueryExportsResponse instance + */ + ListBigQueryExportsResponse.create = function create(properties) { + return new ListBigQueryExportsResponse(properties); + }; + + /** + * Encodes the specified ListBigQueryExportsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsResponse} message ListBigQueryExportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBigQueryExportsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigQueryExports != null && message.bigQueryExports.length) + for (var i = 0; i < message.bigQueryExports.length; ++i) + $root.google.cloud.securitycenter.v1.BigQueryExport.encode(message.bigQueryExports[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 ListBigQueryExportsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ListBigQueryExportsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {google.cloud.securitycenter.v1.IListBigQueryExportsResponse} message ListBigQueryExportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBigQueryExportsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBigQueryExportsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsResponse} ListBigQueryExportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBigQueryExportsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ListBigQueryExportsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.bigQueryExports && message.bigQueryExports.length)) + message.bigQueryExports = []; + message.bigQueryExports.push($root.google.cloud.securitycenter.v1.BigQueryExport.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBigQueryExportsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsResponse} ListBigQueryExportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBigQueryExportsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBigQueryExportsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBigQueryExportsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bigQueryExports != null && message.hasOwnProperty("bigQueryExports")) { + if (!Array.isArray(message.bigQueryExports)) + return "bigQueryExports: array expected"; + for (var i = 0; i < message.bigQueryExports.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.BigQueryExport.verify(message.bigQueryExports[i]); + if (error) + return "bigQueryExports." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBigQueryExportsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ListBigQueryExportsResponse} ListBigQueryExportsResponse + */ + ListBigQueryExportsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ListBigQueryExportsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1.ListBigQueryExportsResponse(); + if (object.bigQueryExports) { + if (!Array.isArray(object.bigQueryExports)) + throw TypeError(".google.cloud.securitycenter.v1.ListBigQueryExportsResponse.bigQueryExports: array expected"); + message.bigQueryExports = []; + for (var i = 0; i < object.bigQueryExports.length; ++i) { + if (typeof object.bigQueryExports[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.ListBigQueryExportsResponse.bigQueryExports: object expected"); + message.bigQueryExports[i] = $root.google.cloud.securitycenter.v1.BigQueryExport.fromObject(object.bigQueryExports[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBigQueryExportsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {google.cloud.securitycenter.v1.ListBigQueryExportsResponse} message ListBigQueryExportsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBigQueryExportsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bigQueryExports = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.bigQueryExports && message.bigQueryExports.length) { + object.bigQueryExports = []; + for (var j = 0; j < message.bigQueryExports.length; ++j) + object.bigQueryExports[j] = $root.google.cloud.securitycenter.v1.BigQueryExport.toObject(message.bigQueryExports[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBigQueryExportsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBigQueryExportsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBigQueryExportsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ListBigQueryExportsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBigQueryExportsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ListBigQueryExportsResponse"; + }; + + return ListBigQueryExportsResponse; + })(); + + v1.DeleteBigQueryExportRequest = (function() { + + /** + * Properties of a DeleteBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @interface IDeleteBigQueryExportRequest + * @property {string|null} [name] DeleteBigQueryExportRequest name + */ + + /** + * Constructs a new DeleteBigQueryExportRequest. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a DeleteBigQueryExportRequest. + * @implements IDeleteBigQueryExportRequest + * @constructor + * @param {google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest=} [properties] Properties to set + */ + function DeleteBigQueryExportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBigQueryExportRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @instance + */ + DeleteBigQueryExportRequest.prototype.name = ""; + + /** + * Creates a new DeleteBigQueryExportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.DeleteBigQueryExportRequest} DeleteBigQueryExportRequest instance + */ + DeleteBigQueryExportRequest.create = function create(properties) { + return new DeleteBigQueryExportRequest(properties); + }; + + /** + * Encodes the specified DeleteBigQueryExportRequest message. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteBigQueryExportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest} message DeleteBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBigQueryExportRequest.encode = function encode(message, writer) { + 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 DeleteBigQueryExportRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.DeleteBigQueryExportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest} message DeleteBigQueryExportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBigQueryExportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBigQueryExportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.DeleteBigQueryExportRequest} DeleteBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBigQueryExportRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest(); + 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 DeleteBigQueryExportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.DeleteBigQueryExportRequest} DeleteBigQueryExportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBigQueryExportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBigQueryExportRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBigQueryExportRequest.verify = function verify(message) { + if (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 DeleteBigQueryExportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.DeleteBigQueryExportRequest} DeleteBigQueryExportRequest + */ + DeleteBigQueryExportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBigQueryExportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {google.cloud.securitycenter.v1.DeleteBigQueryExportRequest} message DeleteBigQueryExportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBigQueryExportRequest.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 DeleteBigQueryExportRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBigQueryExportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBigQueryExportRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.DeleteBigQueryExportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBigQueryExportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.DeleteBigQueryExportRequest"; + }; + + return DeleteBigQueryExportRequest; + })(); + + v1.Source = (function() { + + /** + * Properties of a Source. + * @memberof google.cloud.securitycenter.v1 + * @interface ISource + * @property {string|null} [name] Source name + * @property {string|null} [displayName] Source displayName + * @property {string|null} [description] Source description + * @property {string|null} [canonicalName] Source canonicalName + */ + + /** + * Constructs a new Source. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set + */ + function Source(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Source name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.name = ""; + + /** + * Source displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.displayName = ""; + + /** + * Source description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.description = ""; + + /** + * Source canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1.Source + * @instance + */ + Source.prototype.canonicalName = ""; + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.ISource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); + return writer; + }; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.Source.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Source message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.Source(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 14: { + message.canonicalName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Source message. + * @function verify + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Source.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; + return null; + }; + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.Source) + return object; + var message = new $root.google.cloud.securitycenter.v1.Source(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + return message; + }; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {google.cloud.securitycenter.v1.Source} message Source + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Source.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.canonicalName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + return object; + }; + + /** + * Converts this Source to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.Source + * @instance + * @returns {Object.} JSON object + */ + Source.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Source + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.Source + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Source.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.Source"; + }; + + return Source; + })(); + + return v1; + })(); + + securitycenter.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.securitycenter + * @namespace + */ + var v1beta1 = {}; + + v1beta1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties + * @property {Object.|null} [resourceProperties] Asset resourceProperties + * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Asset securityMarks + * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.resourceProperties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset securityCenterProperties. + * @member {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.securityCenterProperties = null; + + /** + * Asset resourceProperties. + * @member {Object.} resourceProperties + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.resourceProperties = $util.emptyObject; + + /** + * Asset securityMarks. + * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.securityMarks = null; + + /** + * Asset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.createTime = null; + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.securityCenterProperties != null && Object.hasOwnProperty.call(message, "securityCenterProperties")) + $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceProperties != null && Object.hasOwnProperty.call(message, "resourceProperties")) + for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) + $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.Asset(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.resourceProperties[key] = value; + break; + } + case 8: { + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { + var error = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); + if (error) + return "securityCenterProperties." + error; + } + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { + if (!$util.isObject(message.resourceProperties)) + return "resourceProperties: object expected"; + var key = Object.keys(message.resourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); + if (error) + return "resourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Asset) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.securityCenterProperties != null) { + if (typeof object.securityCenterProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.securityCenterProperties: object expected"); + message.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); + } + if (object.resourceProperties) { + if (typeof object.resourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.resourceProperties: object expected"); + message.resourceProperties = {}; + for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.resourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.resourceProperties: object expected"); + message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.resourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.securityCenterProperties = null; + object.securityMarks = null; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + object.securityCenterProperties = $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); + var keys2; + if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { + object.resourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.Asset"; + }; + + Asset.SecurityCenterProperties = (function() { + + /** + * Properties of a SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @interface ISecurityCenterProperties + * @property {string|null} [resourceName] SecurityCenterProperties resourceName + * @property {string|null} [resourceType] SecurityCenterProperties resourceType + * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent + * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject + * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners + */ + + /** + * Constructs a new SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1beta1.Asset + * @classdesc Represents a SecurityCenterProperties. + * @implements ISecurityCenterProperties + * @constructor + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set + */ + function SecurityCenterProperties(properties) { + this.resourceOwners = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityCenterProperties resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceName = ""; + + /** + * SecurityCenterProperties resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceType = ""; + + /** + * SecurityCenterProperties resourceParent. + * @member {string} resourceParent + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParent = ""; + + /** + * SecurityCenterProperties resourceProject. + * @member {string} resourceProject + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProject = ""; + + /** + * SecurityCenterProperties resourceOwners. + * @member {Array.} resourceOwners + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties instance + */ + SecurityCenterProperties.create = function create(properties) { + return new SecurityCenterProperties(properties); + }; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resourceParent != null && Object.hasOwnProperty.call(message, "resourceParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); + if (message.resourceProject != null && Object.hasOwnProperty.call(message, "resourceProject")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); + if (message.resourceOwners != null && message.resourceOwners.length) + for (var i = 0; i < message.resourceOwners.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); + return writer; + }; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resourceName = reader.string(); + break; + } + case 2: { + message.resourceType = reader.string(); + break; + } + case 3: { + message.resourceParent = reader.string(); + break; + } + case 4: { + message.resourceProject = reader.string(); + break; + } + case 5: { + if (!(message.resourceOwners && message.resourceOwners.length)) + message.resourceOwners = []; + message.resourceOwners.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityCenterProperties message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityCenterProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + if (!$util.isString(message.resourceParent)) + return "resourceParent: string expected"; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + if (!$util.isString(message.resourceProject)) + return "resourceProject: string expected"; + if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { + if (!Array.isArray(message.resourceOwners)) + return "resourceOwners: array expected"; + for (var i = 0; i < message.resourceOwners.length; ++i) + if (!$util.isString(message.resourceOwners[i])) + return "resourceOwners: string[] expected"; + } + return null; + }; + + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + */ + SecurityCenterProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resourceParent != null) + message.resourceParent = String(object.resourceParent); + if (object.resourceProject != null) + message.resourceProject = String(object.resourceProject); + if (object.resourceOwners) { + if (!Array.isArray(object.resourceOwners)) + throw TypeError(".google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.resourceOwners: array expected"); + message.resourceOwners = []; + for (var i = 0; i < object.resourceOwners.length; ++i) + message.resourceOwners[i] = String(object.resourceOwners[i]); + } + return message; + }; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties} message SecurityCenterProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityCenterProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceOwners = []; + if (options.defaults) { + object.resourceName = ""; + object.resourceType = ""; + object.resourceParent = ""; + object.resourceProject = ""; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + object.resourceParent = message.resourceParent; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + object.resourceProject = message.resourceProject; + if (message.resourceOwners && message.resourceOwners.length) { + object.resourceOwners = []; + for (var j = 0; j < message.resourceOwners.length; ++j) + object.resourceOwners[j] = message.resourceOwners[j]; + } + return object; + }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @instance + * @returns {Object.} JSON object + */ + SecurityCenterProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityCenterProperties + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityCenterProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties"; + }; + + return SecurityCenterProperties; + })(); + + return Asset; + })(); + + v1beta1.SecurityMarks = (function() { + + /** + * Properties of a SecurityMarks. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ISecurityMarks + * @property {string|null} [name] SecurityMarks name + * @property {Object.|null} [marks] SecurityMarks marks + */ + + /** + * Constructs a new SecurityMarks. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a SecurityMarks. + * @implements ISecurityMarks + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks=} [properties] Properties to set + */ + function SecurityMarks(properties) { + this.marks = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityMarks name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.name = ""; + + /** + * SecurityMarks marks. + * @member {Object.} marks + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.marks = $util.emptyObject; + + /** + * Creates a new SecurityMarks instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks instance + */ + SecurityMarks.create = function create(properties) { + return new SecurityMarks(properties); + }; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityMarks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.marks != null && Object.hasOwnProperty.call(message, "marks")) + for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SecurityMarks.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityMarks.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.SecurityMarks(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.marks === $util.emptyObject) + message.marks = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.marks[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityMarks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityMarks message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityMarks.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.marks != null && message.hasOwnProperty("marks")) { + if (!$util.isObject(message.marks)) + return "marks: object expected"; + var key = Object.keys(message.marks); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.marks[key[i]])) + return "marks: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.SecurityMarks} SecurityMarks + */ + SecurityMarks.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.SecurityMarks) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.SecurityMarks(); + if (object.name != null) + message.name = String(object.name); + if (object.marks) { + if (typeof object.marks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.SecurityMarks.marks: object expected"); + message.marks = {}; + for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) + message.marks[keys[i]] = String(object.marks[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} message SecurityMarks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityMarks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.marks = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.marks && (keys2 = Object.keys(message.marks)).length) { + object.marks = {}; + for (var j = 0; j < keys2.length; ++j) + object.marks[keys2[j]] = message.marks[keys2[j]]; + } + return object; + }; + + /** + * Converts this SecurityMarks to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @instance + * @returns {Object.} JSON object + */ + SecurityMarks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityMarks + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.SecurityMarks + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityMarks.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.SecurityMarks"; + }; + + return SecurityMarks; + })(); + + v1beta1.Finding = (function() { + + /** + * Properties of a Finding. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [parent] Finding parent + * @property {string|null} [resourceName] Finding resourceName + * @property {google.cloud.securitycenter.v1beta1.Finding.State|null} [state] Finding state + * @property {string|null} [category] Finding category + * @property {string|null} [externalUri] Finding externalUri + * @property {Object.|null} [sourceProperties] Finding sourceProperties + * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] Finding securityMarks + * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime + * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + */ + + /** + * Constructs a new Finding. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IFinding=} [properties] Properties to set + */ + function Finding(properties) { + this.sourceProperties = {}; + if (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.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.name = ""; + + /** + * Finding parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.parent = ""; + + /** + * Finding resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.resourceName = ""; + + /** + * Finding state. + * @member {google.cloud.securitycenter.v1beta1.Finding.State} state + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.state = 0; + + /** + * Finding category. + * @member {string} category + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.category = ""; + + /** + * Finding externalUri. + * @member {string} externalUri + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.externalUri = ""; + + /** + * Finding sourceProperties. + * @member {Object.} sourceProperties + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.sourceProperties = $util.emptyObject; + + /** + * Finding securityMarks. + * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.securityMarks = null; + + /** + * Finding eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.eventTime = null; + + /** + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @instance + */ + Finding.prototype.createTime = null; + + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1beta1.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1beta1.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); + if (message.sourceProperties != null && Object.hasOwnProperty.call(message, "sourceProperties")) + for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) + $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.Finding(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.resourceName = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.category = reader.string(); + break; + } + case 6: { + message.externalUri = reader.string(); + break; + } + case 7: { + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.sourceProperties[key] = value; + break; + } + case 8: { + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 9: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.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.securitycenter.v1beta1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { + if (!$util.isObject(message.sourceProperties)) + return "sourceProperties: object expected"; + var key = Object.keys(message.sourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (error) + return "sourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Finding) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.category != null) + message.category = String(object.category); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.sourceProperties) { + if (typeof object.sourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.sourceProperties: object expected"); + message.sourceProperties = {}; + for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.sourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.sourceProperties: object expected"); + message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.Finding.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1beta1.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.objects || options.defaults) + object.sourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.resourceName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.category = ""; + object.externalUri = ""; + object.securityMarks = null; + object.eventTime = null; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + var keys2; + if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { + object.sourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.Finding"; + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1beta1.Finding.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + */ + Finding.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + return values; + })(); + + return Finding; + })(); + + v1beta1.OrganizationSettings = (function() { + + /** + * Properties of an OrganizationSettings. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IOrganizationSettings + * @property {string|null} [name] OrganizationSettings name + * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery + * @property {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + */ + + /** + * Constructs a new OrganizationSettings. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings=} [properties] Properties to set + */ + function OrganizationSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OrganizationSettings name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.name = ""; + + /** + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.enableAssetDiscovery = false; + + /** + * OrganizationSettings assetDiscoveryConfig. + * @member {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.assetDiscoveryConfig = null; + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings instance + */ + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); + }; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.enableAssetDiscovery != null && Object.hasOwnProperty.call(message, "enableAssetDiscovery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); + if (message.assetDiscoveryConfig != null && Object.hasOwnProperty.call(message, "assetDiscoveryConfig")) + $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.enableAssetDiscovery = reader.bool(); + break; + } + case 3: { + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrganizationSettings message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrganizationSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (typeof message.enableAssetDiscovery !== "boolean") + return "enableAssetDiscovery: boolean expected"; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { + var error = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); + if (error) + return "assetDiscoveryConfig." + error; + } + return null; + }; + + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings} OrganizationSettings + */ + OrganizationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.OrganizationSettings) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableAssetDiscovery != null) + message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); + if (object.assetDiscoveryConfig != null) { + if (typeof object.assetDiscoveryConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.OrganizationSettings.assetDiscoveryConfig: object expected"); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + } + return message; + }; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} message OrganizationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrganizationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.enableAssetDiscovery = false; + object.assetDiscoveryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + object.enableAssetDiscovery = message.enableAssetDiscovery; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + return object; + }; + + /** + * Converts this OrganizationSettings to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @instance + * @returns {Object.} JSON object + */ + OrganizationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrganizationSettings + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrganizationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.OrganizationSettings"; + }; + + OrganizationSettings.AssetDiscoveryConfig = (function() { + + /** + * Properties of an AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @interface IAssetDiscoveryConfig + * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds + * @property {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + */ + + /** + * Constructs a new AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings + * @classdesc Represents an AssetDiscoveryConfig. + * @implements IAssetDiscoveryConfig + * @constructor + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + */ + function AssetDiscoveryConfig(properties) { + this.projectIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AssetDiscoveryConfig projectIds. + * @member {Array.} projectIds + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; + + /** + * AssetDiscoveryConfig inclusionMode. + * @member {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.inclusionMode = 0; + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance + */ + AssetDiscoveryConfig.create = function create(properties) { + return new AssetDiscoveryConfig(properties); + }; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectIds != null && message.projectIds.length) + for (var i = 0; i < message.projectIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); + if (message.inclusionMode != null && Object.hasOwnProperty.call(message, "inclusionMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + return writer; + }; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + } + case 2: { + message.inclusionMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssetDiscoveryConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssetDiscoveryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectIds != null && message.hasOwnProperty("projectIds")) { + if (!Array.isArray(message.projectIds)) + return "projectIds: array expected"; + for (var i = 0; i < message.projectIds.length; ++i) + if (!$util.isString(message.projectIds[i])) + return "projectIds: string[] expected"; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + switch (message.inclusionMode) { + default: + return "inclusionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + */ + AssetDiscoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig(); + if (object.projectIds) { + if (!Array.isArray(object.projectIds)) + throw TypeError(".google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); + message.projectIds = []; + for (var i = 0; i < object.projectIds.length; ++i) + message.projectIds[i] = String(object.projectIds[i]); + } + switch (object.inclusionMode) { + default: + if (typeof object.inclusionMode === "number") { + message.inclusionMode = object.inclusionMode; + break; + } + break; + case "INCLUSION_MODE_UNSPECIFIED": + case 0: + message.inclusionMode = 0; + break; + case "INCLUDE_ONLY": + case 1: + message.inclusionMode = 1; + break; + case "EXCLUDE": + case 2: + message.inclusionMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssetDiscoveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.projectIds = []; + if (options.defaults) + object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; + if (message.projectIds && message.projectIds.length) { + object.projectIds = []; + for (var j = 0; j < message.projectIds.length; ++j) + object.projectIds[j] = message.projectIds[j]; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] === undefined ? message.inclusionMode : $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + return object; + }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + * @returns {Object.} JSON object + */ + AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AssetDiscoveryConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssetDiscoveryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig"; + }; + + /** + * InclusionMode enum. + * @name google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * @enum {number} + * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value + * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value + * @property {number} EXCLUDE=2 EXCLUDE value + */ + AssetDiscoveryConfig.InclusionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCLUDE_ONLY"] = 1; + values[valuesById[2] = "EXCLUDE"] = 2; + return values; + })(); + + return AssetDiscoveryConfig; + })(); + + return OrganizationSettings; + })(); + + v1beta1.RunAssetDiscoveryResponse = (function() { + + /** + * Properties of a RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IRunAssetDiscoveryResponse + * @property {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state + * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration + */ + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a RunAssetDiscoveryResponse. + * @implements IRunAssetDiscoveryResponse + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set + */ + function RunAssetDiscoveryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunAssetDiscoveryResponse state. + * @member {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.state = 0; + + /** + * RunAssetDiscoveryResponse duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.duration = null; + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + */ + RunAssetDiscoveryResponse.create = function create(properties) { + return new RunAssetDiscoveryResponse(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + */ + RunAssetDiscoveryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLETED": + case 1: + message.state = 1; + break; + case "SUPERSEDED": + case 2: + message.state = 2; + break; + case "TERMINATED": + case 3: + message.state = 3; + break; + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.duration = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State[message.state] : message.state; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunAssetDiscoveryResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAssetDiscoveryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse"; + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1beta1.RunAssetDiscoveryResponse.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} COMPLETED=1 COMPLETED value + * @property {number} SUPERSEDED=2 SUPERSEDED value + * @property {number} TERMINATED=3 TERMINATED value + */ + RunAssetDiscoveryResponse.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPLETED"] = 1; + values[valuesById[2] = "SUPERSEDED"] = 2; + values[valuesById[3] = "TERMINATED"] = 3; + return values; + })(); + + return RunAssetDiscoveryResponse; + })(); + + v1beta1.SecurityCenter = (function() { + + /** + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a SecurityCenter + * @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 SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; + + /** + * Creates new SecurityCenter service using the specified rpc implementation. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + */ + SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|createSource}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source + */ + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); + }, "name", { value: "CreateSource" }); + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|createFinding}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + */ + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { + return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); + }, "name", { value: "CreateFinding" }); + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|getIamPolicy}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|getOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GetOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { + return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1beta1.OrganizationSettings, request, callback); + }, "name", { value: "GetOrganizationSettings" }); + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|getSource}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source + */ + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1beta1.GetSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); + }, "name", { value: "GetSource" }); + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|groupAssets}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GroupAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} [response] GroupAssetsResponse + */ + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { + return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse, request, callback); + }, "name", { value: "GroupAssets" }); + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|groupFindings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} [response] GroupFindingsResponse + */ + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { + return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|listAssets}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest, $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|listFindings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.ListFindingsResponse} [response] ListFindingsResponse + */ + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest, $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|listSources}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.ListSourcesResponse} [response] ListSourcesResponse + */ + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest, $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|runAssetDiscovery}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef RunAssetDiscoveryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { + return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunAssetDiscovery" }); + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|setFindingState}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + */ + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { + return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); + }, "name", { value: "SetFindingState" }); + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|setIamPolicy}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|testIamPermissions}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateFinding}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Finding} [response] Finding + */ + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { + return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1beta1.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { + return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1beta1.OrganizationSettings, request, callback); + }, "name", { value: "UpdateOrganizationSettings" }); + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateSource}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.Source} [response] Source + */ + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1beta1.Source, request, callback); + }, "name", { value: "UpdateSource" }); + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1beta1.SecurityCenter|updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @typedef UpdateSecurityMarksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} [response] SecurityMarks + */ + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { + return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1beta1.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecurityCenter; + })(); + + v1beta1.CreateFindingRequest = (function() { + + /** + * Properties of a CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v1beta1.IFinding|null} [finding] CreateFindingRequest finding + */ + + /** + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest=} [properties] Properties to set + */ + function CreateFindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateFindingRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.parent = ""; + + /** + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.findingId = ""; + + /** + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.finding = null; + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest instance + */ + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); + }; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.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.findingId != null && Object.hasOwnProperty.call(message, "findingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.findingId = reader.string(); + break; + } + case 3: { + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFindingRequest.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.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + return null; + }; + + /** + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.CreateFindingRequest} CreateFindingRequest + */ + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.CreateFindingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.findingId != null) + message.findingId = String(object.findingId); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.finding); + } + return message; + }; + + /** + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.CreateFindingRequest} message CreateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.findingId = ""; + object.finding = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.finding, options); + return object; + }; + + /** + * Converts this CreateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.CreateFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.CreateFindingRequest"; + }; + + return CreateFindingRequest; + })(); + + v1beta1.CreateSourceRequest = (function() { + + /** + * Properties of a CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v1beta1.ISource|null} [source] CreateSourceRequest source + */ + + /** + * Constructs a new CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest=} [properties] Properties to set + */ + function CreateSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.parent = ""; + + /** + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v1beta1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.source = null; + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest instance + */ + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); + }; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.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.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.CreateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSourceRequest.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.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; + + /** + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.CreateSourceRequest} CreateSourceRequest + */ + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.source); + } + return message; + }; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.CreateSourceRequest} message CreateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.source = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.source, options); + return object; + }; + + /** + * Converts this CreateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.CreateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.CreateSourceRequest"; + }; + + return CreateSourceRequest; + })(); + + v1beta1.GetOrganizationSettingsRequest = (function() { + + /** + * Properties of a GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name + */ + + /** + * Constructs a new GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GetOrganizationSettingsRequest. + * @implements IGetOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set + */ + function GetOrganizationSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOrganizationSettingsRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @instance + */ + GetOrganizationSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance + */ + GetOrganizationSettingsRequest.create = function create(properties) { + return new GetOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationSettingsRequest.encode = function encode(message, writer) { + 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 GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationSettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest(); + 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 GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOrganizationSettingsRequest.verify = function verify(message) { + if (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 GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + */ + GetOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOrganizationSettingsRequest.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 GetOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOrganizationSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOrganizationSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest"; + }; + + return GetOrganizationSettingsRequest; + })(); + + v1beta1.GetSourceRequest = (function() { + + /** + * Properties of a GetSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name + */ + + /** + * Constructs a new GetSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest=} [properties] Properties to set + */ + function GetSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSourceRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @instance + */ + GetSourceRequest.prototype.name = ""; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest instance + */ + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); + }; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.encode = function encode(message, writer) { + 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 GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GetSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GetSourceRequest(); + 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 GetSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSourceRequest.verify = function verify(message) { + if (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 GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GetSourceRequest} GetSourceRequest + */ + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GetSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GetSourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.GetSourceRequest} message GetSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSourceRequest.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 GetSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GetSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GetSourceRequest"; + }; + + return GetSourceRequest; + })(); + + v1beta1.GroupAssetsRequest = (function() { + + /** + * Properties of a GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupAssetsRequest + * @property {string|null} [parent] GroupAssetsRequest parent + * @property {string|null} [filter] GroupAssetsRequest filter + * @property {string|null} [groupBy] GroupAssetsRequest groupBy + * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime + * @property {string|null} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize + */ + + /** + * Constructs a new GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest=} [properties] Properties to set + */ + function GroupAssetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.parent = ""; + + /** + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.filter = ""; + + /** + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.groupBy = ""; + + /** + * GroupAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.compareDuration = null; + + /** + * GroupAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.readTime = null; + + /** + * GroupAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageToken = ""; + + /** + * GroupAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest instance + */ + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); + }; + + /** + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsRequest.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.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest(); + 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.groupBy = reader.string(); + break; + } + case 4: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupAssetsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupAssetsRequest.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.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + 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 GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} GroupAssetsRequest + */ + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + 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 GroupAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.GroupAssetsRequest} message GroupAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.compareDuration = null; + object.readTime = null; + 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.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + 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 GroupAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GroupAssetsRequest"; + }; + + return GroupAssetsRequest; + })(); + + v1beta1.GroupAssetsResponse = (function() { + + /** + * Properties of a GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupAssetsResponse + * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime + * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken + */ + + /** + * Constructs a new GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse=} [properties] Properties to set + */ + function GroupAssetsResponse(properties) { + this.groupByResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupAssetsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.readTime = null; + + /** + * GroupAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse instance + */ + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); + }; + + /** + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupAssetsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} GroupAssetsResponse + */ + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GroupAssetsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1beta1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.GroupAssetsResponse} message GroupAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1beta1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this GroupAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GroupAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GroupAssetsResponse"; + }; + + return GroupAssetsResponse; + })(); + + v1beta1.GroupFindingsRequest = (function() { + + /** + * Properties of a GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize + */ + + /** + * Constructs a new GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest=} [properties] Properties to set + */ + function GroupFindingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.parent = ""; + + /** + * GroupFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.filter = ""; + + /** + * GroupFindingsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.groupBy = ""; + + /** + * GroupFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.readTime = null; + + /** + * GroupFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageToken = ""; + + /** + * GroupFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest instance + */ + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); + }; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsRequest.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.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest(); + 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.groupBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupFindingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupFindingsRequest.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.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + 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 GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} GroupFindingsRequest + */ + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + 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 GroupFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.GroupFindingsRequest} message GroupFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.readTime = null; + 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.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + 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 GroupFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GroupFindingsRequest"; + }; + + return GroupFindingsRequest; + })(); + + v1beta1.GroupFindingsResponse = (function() { + + /** + * Properties of a GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken + */ + + /** + * Constructs a new GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse=} [properties] Properties to set + */ + function GroupFindingsResponse(properties) { + this.groupByResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupFindingsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.readTime = null; + + /** + * GroupFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse instance + */ + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); + }; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1beta1.GroupResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupFindingsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} GroupFindingsResponse + */ + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GroupFindingsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1beta1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.GroupFindingsResponse} message GroupFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1beta1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GroupFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GroupFindingsResponse"; + }; + + return GroupFindingsResponse; + })(); + + v1beta1.GroupResult = (function() { + + /** + * Properties of a GroupResult. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count + */ + + /** + * Constructs a new GroupResult. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a GroupResult. + * @implements IGroupResult + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IGroupResult=} [properties] Properties to set + */ + function GroupResult(properties) { + this.properties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupResult properties. + * @member {Object.} properties + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @instance + */ + GroupResult.prototype.properties = $util.emptyObject; + + /** + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @instance + */ + GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new GroupResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult instance + */ + GroupResult.create = function create(properties) { + return new GroupResult(properties); + }; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupResult} message GroupResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.GroupResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1beta1.IGroupResult} message GroupResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.GroupResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.properties === $util.emptyObject) + message.properties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; + break; + } + case 2: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.GroupResult} GroupResult + */ + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.GroupResult) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupResult.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.GroupResult.properties: object expected"); + message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + } + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1beta1.GroupResult} message GroupResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); + } + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this GroupResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @instance + * @returns {Object.} JSON object + */ + GroupResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.GroupResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.GroupResult"; + }; + + return GroupResult; + })(); + + v1beta1.ListSourcesRequest = (function() { + + /** + * Properties of a ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListSourcesRequest + * @property {string|null} [parent] ListSourcesRequest parent + * @property {string|null} [pageToken] ListSourcesRequest pageToken + * @property {number|null} [pageSize] ListSourcesRequest pageSize + */ + + /** + * Constructs a new ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListSourcesRequest. + * @implements IListSourcesRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest=} [properties] Properties to set + */ + function ListSourcesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.parent = ""; + + /** + * ListSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageToken = ""; + + /** + * ListSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest instance + */ + ListSourcesRequest.create = function create(properties) { + return new ListSourcesRequest(properties); + }; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.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 7, wireType 0 =*/56).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest(); + 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 7: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesRequest.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 ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesRequest} ListSourcesRequest + */ + ListSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesRequest(); + 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 ListSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ListSourcesRequest} message ListSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesRequest.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 ListSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.ListSourcesRequest"; + }; + + return ListSourcesRequest; + })(); + + v1beta1.ListSourcesResponse = (function() { + + /** + * Properties of a ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListSourcesResponse + * @property {Array.|null} [sources] ListSourcesResponse sources + * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken + */ + + /** + * Constructs a new ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListSourcesResponse. + * @implements IListSourcesResponse + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse=} [properties] Properties to set + */ + function ListSourcesResponse(properties) { + this.sources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSourcesResponse sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.sources = $util.emptyArray; + + /** + * ListSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse instance + */ + ListSourcesResponse.create = function create(properties) { + return new ListSourcesResponse(properties); + }; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.securitycenter.v1beta1.Source.encode(message.sources[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 ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.sources[i]); + if (error) + return "sources." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListSourcesResponse} ListSourcesResponse + */ + ListSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListSourcesResponse(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v1beta1.ListSourcesResponse.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListSourcesResponse.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.sources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.ListSourcesResponse} message ListSourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sources = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.sources[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.ListSourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.ListSourcesResponse"; + }; + + return ListSourcesResponse; + })(); + + v1beta1.ListAssetsRequest = (function() { + + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {string|null} [filter] ListAssetsRequest filter + * @property {string|null} [orderBy] ListAssetsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask + * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {number|null} [pageSize] ListAssetsRequest pageSize + */ + + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; + + /** + * ListAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.filter = ""; + + /** + * ListAssetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.orderBy = ""; + + /** + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.readTime = null; + + /** + * ListAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.compareDuration = null; + + /** + * ListAssetsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.fieldMask = null; + + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest(); + 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.orderBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 8: { + message.pageToken = reader.string(); + break; + } + case 9: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsRequest.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsRequest} ListAssetsRequest + */ + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + 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 ListAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsRequest} message ListAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + 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.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + 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 ListAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.ListAssetsRequest"; + }; + + return ListAssetsRequest; + })(); + + v1beta1.ListAssetsResponse = (function() { + + /** + * Properties of a ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListAssetsResponse + * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + * @property {number|null} [totalSize] ListAssetsResponse totalSize + */ + + /** + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse=} [properties] Properties to set + */ + function ListAssetsResponse(properties) { + this.listAssetsResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssetsResponse listAssetsResults. + * @member {Array.} listAssetsResults + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; + + /** + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.readTime = null; + + /** + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.nextPageToken = ""; + + /** + * ListAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse instance + */ + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); + }; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listAssetsResults != null && message.listAssetsResults.length) + for (var i = 0; i < message.listAssetsResults.length; ++i) + $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.listAssetsResults && message.listAssetsResults.length)) + message.listAssetsResults = []; + message.listAssetsResults.push($root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { + if (!Array.isArray(message.listAssetsResults)) + return "listAssetsResults: array expected"; + for (var i = 0; i < message.listAssetsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); + if (error) + return "listAssetsResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse} ListAssetsResponse + */ + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse(); + if (object.listAssetsResults) { + if (!Array.isArray(object.listAssetsResults)) + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.listAssetsResults: array expected"); + message.listAssetsResults = []; + for (var i = 0; i < object.listAssetsResults.length; ++i) { + if (typeof object.listAssetsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.listAssetsResults: object expected"); + message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse} message ListAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listAssetsResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.listAssetsResults && message.listAssetsResults.length) { + object.listAssetsResults = []; + for (var j = 0; j < message.listAssetsResults.length; ++j) + object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.ListAssetsResponse"; + }; + + ListAssetsResponse.ListAssetsResult = (function() { + + /** + * Properties of a ListAssetsResult. + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @interface IListAssetsResult + * @property {google.cloud.securitycenter.v1beta1.IAsset|null} [asset] ListAssetsResult asset + * @property {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State|null} [state] ListAssetsResult state + */ + + /** + * Constructs a new ListAssetsResult. + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse + * @classdesc Represents a ListAssetsResult. + * @implements IListAssetsResult + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + */ + function ListAssetsResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssetsResult asset. + * @member {google.cloud.securitycenter.v1beta1.IAsset|null|undefined} asset + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.asset = null; + + /** + * ListAssetsResult state. + * @member {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State} state + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.state = 0; + + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance + */ + ListAssetsResult.create = function create(properties) { + return new ListAssetsResult(properties); + }; + + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + $root.google.cloud.securitycenter.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + return writer; + }; + + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.decode(reader, reader.uint32()); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.securitycenter.v1beta1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + */ + ListAssetsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.asset: object expected"); + message.asset = $root.google.cloud.securitycenter.v1beta1.Asset.fromObject(object.asset); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "UNUSED": + case 1: + message.state = 1; + break; + case "ADDED": + case 2: + message.state = 2; + break; + case "REMOVED": + case 3: + message.state = 3; + break; + case "ACTIVE": + case 4: + message.state = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.asset = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.securitycenter.v1beta1.Asset.toObject(message.asset, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State[message.state] : message.state; + return object; + }; + + /** + * Converts this ListAssetsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult"; + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} UNUSED=1 UNUSED value + * @property {number} ADDED=2 ADDED value + * @property {number} REMOVED=3 REMOVED value + * @property {number} ACTIVE=4 ACTIVE value + */ + ListAssetsResult.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNUSED"] = 1; + values[valuesById[2] = "ADDED"] = 2; + values[valuesById[3] = "REMOVED"] = 3; + values[valuesById[4] = "ACTIVE"] = 4; + return values; + })(); + + return ListAssetsResult; + })(); + + return ListAssetsResponse; + })(); + + v1beta1.ListFindingsRequest = (function() { + + /** + * Properties of a ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [orderBy] ListFindingsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask + * @property {string|null} [pageToken] ListFindingsRequest pageToken + * @property {number|null} [pageSize] ListFindingsRequest pageSize + */ + + /** + * Constructs a new ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.parent = ""; + + /** + * ListFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.filter = ""; + + /** + * ListFindingsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.orderBy = ""; + + /** + * ListFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.readTime = null; + + /** + * ListFindingsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.fieldMask = null; + + /** + * ListFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageToken = ""; + + /** + * ListFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest instance + */ + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); + }; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.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.orderBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + case 7: { + 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.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + 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.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsRequest} ListFindingsRequest + */ + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + 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.securitycenter.v1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.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.orderBy = ""; + object.readTime = null; + object.fieldMask = null; + 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.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + 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.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.ListFindingsRequest"; + }; + + return ListFindingsRequest; + })(); + + v1beta1.ListFindingsResponse = (function() { + + /** + * Properties of a ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IListFindingsResponse + * @property {Array.|null} [findings] ListFindingsResponse findings + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + * @property {number|null} [totalSize] ListFindingsResponse totalSize + */ + + /** + * Constructs a new ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.findings = $util.emptyArray; + + /** + * ListFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.readTime = null; + + /** + * ListFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.nextPageToken = ""; + + /** + * ListFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse instance + */ + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); + }; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.Finding.encode(message.findings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.ListFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.Finding.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + 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.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.Finding.verify(message.findings[i]); + if (error) + return "findings." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.ListFindingsResponse} ListFindingsResponse + */ + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.ListFindingsResponse(); + if (object.findings) { + if (!Array.isArray(object.findings)) + throw TypeError(".google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.ListFindingsResponse.findings: object expected"); + message.findings[i] = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.findings[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.ListFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1beta1.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.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.findings && message.findings.length) { + object.findings = []; + for (var j = 0; j < message.findings.length; ++j) + object.findings[j] = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.findings[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.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.securitycenter.v1beta1.ListFindingsResponse"; + }; + + return ListFindingsResponse; + })(); + + v1beta1.SetFindingStateRequest = (function() { + + /** + * Properties of a SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ISetFindingStateRequest + * @property {string|null} [name] SetFindingStateRequest name + * @property {google.cloud.securitycenter.v1beta1.Finding.State|null} [state] SetFindingStateRequest state + * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + */ + + /** + * Constructs a new SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest=} [properties] Properties to set + */ + function SetFindingStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetFindingStateRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.name = ""; + + /** + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v1beta1.Finding.State} state + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.state = 0; + + /** + * SetFindingStateRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.startTime = null; + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest instance + */ + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); + }; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.SetFindingStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetFindingStateRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetFindingStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} SetFindingStateRequest + */ + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.SetFindingStateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.SetFindingStateRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.SetFindingStateRequest} message SetFindingStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetFindingStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1beta1.Finding.State[message.state] : message.state; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @instance + * @returns {Object.} JSON object + */ + SetFindingStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetFindingStateRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.SetFindingStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetFindingStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.SetFindingStateRequest"; + }; + + return SetFindingStateRequest; + })(); + + v1beta1.RunAssetDiscoveryRequest = (function() { + + /** + * Properties of a RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IRunAssetDiscoveryRequest + * @property {string|null} [parent] RunAssetDiscoveryRequest parent + */ + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a RunAssetDiscoveryRequest. + * @implements IRunAssetDiscoveryRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + */ + function RunAssetDiscoveryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunAssetDiscoveryRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @instance + */ + RunAssetDiscoveryRequest.prototype.parent = ""; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance + */ + RunAssetDiscoveryRequest.create = function create(properties) { + return new RunAssetDiscoveryRequest(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.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 RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest(); + 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 RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryRequest.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 RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + */ + RunAssetDiscoveryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryRequest.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 RunAssetDiscoveryRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunAssetDiscoveryRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAssetDiscoveryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest"; + }; + + return RunAssetDiscoveryRequest; + })(); + + v1beta1.UpdateFindingRequest = (function() { + + /** + * Properties of an UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateFindingRequest + * @property {google.cloud.securitycenter.v1beta1.IFinding|null} [finding] UpdateFindingRequest finding + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask + */ + + /** + * Constructs a new UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateFindingRequest. + * @implements IUpdateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest=} [properties] Properties to set + */ + function UpdateFindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateFindingRequest finding. + * @member {google.cloud.securitycenter.v1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.finding = null; + + /** + * UpdateFindingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest instance + */ + UpdateFindingRequest.create = function create(properties) { + return new UpdateFindingRequest(properties); + }; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1beta1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1beta1.Finding.verify(message.finding); + if (error) + return "finding." + 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 UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} UpdateFindingRequest + */ + UpdateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateFindingRequest(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1beta1.Finding.fromObject(object.finding); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateFindingRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.UpdateFindingRequest} message UpdateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finding = null; + object.updateMask = null; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1beta1.Finding.toObject(message.finding, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.UpdateFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.UpdateFindingRequest"; + }; + + return UpdateFindingRequest; + })(); + + v1beta1.UpdateOrganizationSettingsRequest = (function() { + + /** + * Properties of an UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateOrganizationSettingsRequest + * @property {google.cloud.securitycenter.v1beta1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask + */ + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateOrganizationSettingsRequest. + * @implements IUpdateOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + */ + function UpdateOrganizationSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateOrganizationSettingsRequest organizationSettings. + * @member {google.cloud.securitycenter.v1beta1.IOrganizationSettings|null|undefined} organizationSettings + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; + + /** + * UpdateOrganizationSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance + */ + UpdateOrganizationSettingsRequest.create = function create(properties) { + return new UpdateOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organizationSettings != null && Object.hasOwnProperty.call(message, "organizationSettings")) + $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateOrganizationSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { + var error = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.verify(message.organizationSettings); + if (error) + return "organizationSettings." + 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 UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + */ + UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest(); + if (object.organizationSettings != null) { + if (typeof object.organizationSettings !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); + message.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.fromObject(object.organizationSettings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.organizationSettings = null; + object.updateMask = null; + } + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + object.organizationSettings = $root.google.cloud.securitycenter.v1beta1.OrganizationSettings.toObject(message.organizationSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateOrganizationSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateOrganizationSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest"; + }; + + return UpdateOrganizationSettingsRequest; + })(); + + v1beta1.UpdateSourceRequest = (function() { + + /** + * Properties of an UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateSourceRequest + * @property {google.cloud.securitycenter.v1beta1.ISource|null} [source] UpdateSourceRequest source + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + */ + + /** + * Constructs a new UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateSourceRequest. + * @implements IUpdateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest=} [properties] Properties to set + */ + function UpdateSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSourceRequest source. + * @member {google.cloud.securitycenter.v1beta1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.source = null; + + /** + * UpdateSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest instance + */ + UpdateSourceRequest.create = function create(properties) { + return new UpdateSourceRequest(properties); + }; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.securitycenter.v1beta1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.securitycenter.v1beta1.Source.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1beta1.Source.verify(message.source); + if (error) + return "source." + 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 UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} UpdateSourceRequest + */ + UpdateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateSourceRequest(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1beta1.Source.fromObject(object.source); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.UpdateSourceRequest} message UpdateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.updateMask = null; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1beta1.Source.toObject(message.source, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.UpdateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.UpdateSourceRequest"; + }; + + return UpdateSourceRequest; + })(); + + v1beta1.UpdateSecurityMarksRequest = (function() { + + /** + * Properties of an UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface IUpdateSecurityMarksRequest + * @property {google.cloud.securitycenter.v1beta1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime + */ + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents an UpdateSecurityMarksRequest. + * @implements IUpdateSecurityMarksRequest + * @constructor + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set + */ + function UpdateSecurityMarksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSecurityMarksRequest securityMarks. + * @member {google.cloud.securitycenter.v1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.securityMarks = null; + + /** + * UpdateSecurityMarksRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.updateMask = null; + + /** + * UpdateSecurityMarksRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.startTime = null; + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance + */ + UpdateSecurityMarksRequest.create = function create(properties) { + return new UpdateSecurityMarksRequest(properties); + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) + $root.google.cloud.securitycenter.v1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSecurityMarksRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSecurityMarksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + */ + UpdateSecurityMarksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest(); + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSecurityMarksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityMarks = null; + object.updateMask = null; + object.startTime = null; + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSecurityMarksRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSecurityMarksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest"; + }; + + return UpdateSecurityMarksRequest; + })(); + + v1beta1.Source = (function() { + + /** + * Properties of a Source. + * @memberof google.cloud.securitycenter.v1beta1 + * @interface ISource + * @property {string|null} [name] Source name + * @property {string|null} [displayName] Source displayName + * @property {string|null} [description] Source description + */ + + /** + * Constructs a new Source. + * @memberof google.cloud.securitycenter.v1beta1 + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.cloud.securitycenter.v1beta1.ISource=} [properties] Properties to set + */ + function Source(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Source name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1beta1.Source + * @instance + */ + Source.prototype.name = ""; + + /** + * Source displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1beta1.Source + * @instance + */ + Source.prototype.displayName = ""; + + /** + * Source description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1beta1.Source + * @instance + */ + Source.prototype.description = ""; + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1beta1.ISource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1beta1.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1beta1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1beta1.Source.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1beta1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Source message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1beta1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1beta1.Source(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1beta1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Source message. + * @function verify + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Source.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1beta1.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1beta1.Source) + return object; + var message = new $root.google.cloud.securitycenter.v1beta1.Source(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1beta1.Source} message Source + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Source.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Source to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1beta1.Source + * @instance + * @returns {Object.} JSON object + */ + Source.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Source + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1beta1.Source + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Source.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1beta1.Source"; + }; + + return Source; + })(); + + return v1beta1; + })(); + + securitycenter.v1p1beta1 = (function() { + + /** + * Namespace v1p1beta1. + * @memberof google.cloud.securitycenter + * @namespace + */ + var v1p1beta1 = {}; + + v1p1beta1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties|null} [securityCenterProperties] Asset securityCenterProperties + * @property {Object.|null} [resourceProperties] Asset resourceProperties + * @property {google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null} [securityMarks] Asset securityMarks + * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * @property {google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy|null} [iamPolicy] Asset iamPolicy + * @property {string|null} [canonicalName] Asset canonicalName + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.resourceProperties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset securityCenterProperties. + * @member {google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties|null|undefined} securityCenterProperties + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.securityCenterProperties = null; + + /** + * Asset resourceProperties. + * @member {Object.} resourceProperties + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.resourceProperties = $util.emptyObject; + + /** + * Asset securityMarks. + * @member {google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.securityMarks = null; + + /** + * Asset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.createTime = null; + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Asset iamPolicy. + * @member {google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy|null|undefined} iamPolicy + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + */ + Asset.prototype.canonicalName = ""; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.securityCenterProperties != null && Object.hasOwnProperty.call(message, "securityCenterProperties")) + $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.encode(message.securityCenterProperties, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceProperties != null && Object.hasOwnProperty.call(message, "resourceProperties")) + for (var keys = Object.keys(message.resourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.resourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) + $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) + $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.encode(message.iamPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.canonicalName); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.Asset(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.securityCenterProperties = $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.resourceProperties === $util.emptyObject) + message.resourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.resourceProperties[key] = value; + break; + } + case 8: { + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.iamPolicy = $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.decode(reader, reader.uint32()); + break; + } + case 13: { + message.canonicalName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.verify(message.securityCenterProperties); + if (error) + return "securityCenterProperties." + error; + } + if (message.resourceProperties != null && message.hasOwnProperty("resourceProperties")) { + if (!$util.isObject(message.resourceProperties)) + return "resourceProperties: object expected"; + var key = Object.keys(message.resourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.resourceProperties[key[i]]); + if (error) + return "resourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Asset) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.securityCenterProperties != null) { + if (typeof object.securityCenterProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.securityCenterProperties: object expected"); + message.securityCenterProperties = $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.fromObject(object.securityCenterProperties); + } + if (object.resourceProperties) { + if (typeof object.resourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.resourceProperties: object expected"); + message.resourceProperties = {}; + for (var keys = Object.keys(object.resourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.resourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.resourceProperties: object expected"); + message.resourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.resourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.fromObject(object.iamPolicy); + } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.resourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.securityCenterProperties = null; + object.securityMarks = null; + object.createTime = null; + object.updateTime = null; + object.iamPolicy = null; + object.canonicalName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.securityCenterProperties != null && message.hasOwnProperty("securityCenterProperties")) + object.securityCenterProperties = $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.toObject(message.securityCenterProperties, options); + var keys2; + if (message.resourceProperties && (keys2 = Object.keys(message.resourceProperties)).length) { + object.resourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.resourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.toObject(message.iamPolicy, options); + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.Asset"; + }; + + Asset.SecurityCenterProperties = (function() { + + /** + * Properties of a SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @interface ISecurityCenterProperties + * @property {string|null} [resourceName] SecurityCenterProperties resourceName + * @property {string|null} [resourceType] SecurityCenterProperties resourceType + * @property {string|null} [resourceParent] SecurityCenterProperties resourceParent + * @property {string|null} [resourceProject] SecurityCenterProperties resourceProject + * @property {Array.|null} [resourceOwners] SecurityCenterProperties resourceOwners + * @property {string|null} [resourceDisplayName] SecurityCenterProperties resourceDisplayName + * @property {string|null} [resourceParentDisplayName] SecurityCenterProperties resourceParentDisplayName + * @property {string|null} [resourceProjectDisplayName] SecurityCenterProperties resourceProjectDisplayName + * @property {Array.|null} [folders] SecurityCenterProperties folders + */ + + /** + * Constructs a new SecurityCenterProperties. + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @classdesc Represents a SecurityCenterProperties. + * @implements ISecurityCenterProperties + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set + */ + function SecurityCenterProperties(properties) { + this.resourceOwners = []; + this.folders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityCenterProperties resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceName = ""; + + /** + * SecurityCenterProperties resourceType. + * @member {string} resourceType + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceType = ""; + + /** + * SecurityCenterProperties resourceParent. + * @member {string} resourceParent + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParent = ""; + + /** + * SecurityCenterProperties resourceProject. + * @member {string} resourceProject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProject = ""; + + /** + * SecurityCenterProperties resourceOwners. + * @member {Array.} resourceOwners + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceOwners = $util.emptyArray; + + /** + * SecurityCenterProperties resourceDisplayName. + * @member {string} resourceDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceDisplayName = ""; + + /** + * SecurityCenterProperties resourceParentDisplayName. + * @member {string} resourceParentDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceParentDisplayName = ""; + + /** + * SecurityCenterProperties resourceProjectDisplayName. + * @member {string} resourceProjectDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.resourceProjectDisplayName = ""; + + /** + * SecurityCenterProperties folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + */ + SecurityCenterProperties.prototype.folders = $util.emptyArray; + + /** + * Creates a new SecurityCenterProperties instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties instance + */ + SecurityCenterProperties.create = function create(properties) { + return new SecurityCenterProperties(properties); + }; + + /** + * Encodes the specified SecurityCenterProperties message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resourceParent != null && Object.hasOwnProperty.call(message, "resourceParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceParent); + if (message.resourceProject != null && Object.hasOwnProperty.call(message, "resourceProject")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceProject); + if (message.resourceOwners != null && message.resourceOwners.length) + for (var i = 0; i < message.resourceOwners.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceOwners[i]); + if (message.resourceDisplayName != null && Object.hasOwnProperty.call(message, "resourceDisplayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceDisplayName); + if (message.resourceParentDisplayName != null && Object.hasOwnProperty.call(message, "resourceParentDisplayName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.resourceParentDisplayName); + if (message.resourceProjectDisplayName != null && Object.hasOwnProperty.call(message, "resourceProjectDisplayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceProjectDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.Folder.encode(message.folders[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityCenterProperties message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.ISecurityCenterProperties} message SecurityCenterProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityCenterProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resourceName = reader.string(); + break; + } + case 2: { + message.resourceType = reader.string(); + break; + } + case 3: { + message.resourceParent = reader.string(); + break; + } + case 4: { + message.resourceProject = reader.string(); + break; + } + case 5: { + if (!(message.resourceOwners && message.resourceOwners.length)) + message.resourceOwners = []; + message.resourceOwners.push(reader.string()); + break; + } + case 6: { + message.resourceDisplayName = reader.string(); + break; + } + case 7: { + message.resourceParentDisplayName = reader.string(); + break; + } + case 8: { + message.resourceProjectDisplayName = reader.string(); + break; + } + case 10: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1p1beta1.Folder.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityCenterProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityCenterProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityCenterProperties message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityCenterProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + if (!$util.isString(message.resourceParent)) + return "resourceParent: string expected"; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + if (!$util.isString(message.resourceProject)) + return "resourceProject: string expected"; + if (message.resourceOwners != null && message.hasOwnProperty("resourceOwners")) { + if (!Array.isArray(message.resourceOwners)) + return "resourceOwners: array expected"; + for (var i = 0; i < message.resourceOwners.length; ++i) + if (!$util.isString(message.resourceOwners[i])) + return "resourceOwners: string[] expected"; + } + if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + if (!$util.isString(message.resourceDisplayName)) + return "resourceDisplayName: string expected"; + if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + if (!$util.isString(message.resourceParentDisplayName)) + return "resourceParentDisplayName: string expected"; + if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + if (!$util.isString(message.resourceProjectDisplayName)) + return "resourceProjectDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } + return null; + }; + + /** + * Creates a SecurityCenterProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties} SecurityCenterProperties + */ + SecurityCenterProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resourceParent != null) + message.resourceParent = String(object.resourceParent); + if (object.resourceProject != null) + message.resourceProject = String(object.resourceProject); + if (object.resourceOwners) { + if (!Array.isArray(object.resourceOwners)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.resourceOwners: array expected"); + message.resourceOwners = []; + for (var i = 0; i < object.resourceOwners.length; ++i) + message.resourceOwners[i] = String(object.resourceOwners[i]); + } + if (object.resourceDisplayName != null) + message.resourceDisplayName = String(object.resourceDisplayName); + if (object.resourceParentDisplayName != null) + message.resourceParentDisplayName = String(object.resourceParentDisplayName); + if (object.resourceProjectDisplayName != null) + message.resourceProjectDisplayName = String(object.resourceProjectDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1p1beta1.Folder.fromObject(object.folders[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SecurityCenterProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties} message SecurityCenterProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityCenterProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resourceOwners = []; + object.folders = []; + } + if (options.defaults) { + object.resourceName = ""; + object.resourceType = ""; + object.resourceParent = ""; + object.resourceProject = ""; + object.resourceDisplayName = ""; + object.resourceParentDisplayName = ""; + object.resourceProjectDisplayName = ""; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resourceParent != null && message.hasOwnProperty("resourceParent")) + object.resourceParent = message.resourceParent; + if (message.resourceProject != null && message.hasOwnProperty("resourceProject")) + object.resourceProject = message.resourceProject; + if (message.resourceOwners && message.resourceOwners.length) { + object.resourceOwners = []; + for (var j = 0; j < message.resourceOwners.length; ++j) + object.resourceOwners[j] = message.resourceOwners[j]; + } + if (message.resourceDisplayName != null && message.hasOwnProperty("resourceDisplayName")) + object.resourceDisplayName = message.resourceDisplayName; + if (message.resourceParentDisplayName != null && message.hasOwnProperty("resourceParentDisplayName")) + object.resourceParentDisplayName = message.resourceParentDisplayName; + if (message.resourceProjectDisplayName != null && message.hasOwnProperty("resourceProjectDisplayName")) + object.resourceProjectDisplayName = message.resourceProjectDisplayName; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1p1beta1.Folder.toObject(message.folders[j], options); + } + return object; + }; + + /** + * Converts this SecurityCenterProperties to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @instance + * @returns {Object.} JSON object + */ + SecurityCenterProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityCenterProperties + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityCenterProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties"; + }; + + return SecurityCenterProperties; + })(); + + Asset.IamPolicy = (function() { + + /** + * Properties of an IamPolicy. + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @interface IIamPolicy + * @property {string|null} [policyBlob] IamPolicy policyBlob + */ + + /** + * Constructs a new IamPolicy. + * @memberof google.cloud.securitycenter.v1p1beta1.Asset + * @classdesc Represents an IamPolicy. + * @implements IIamPolicy + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy=} [properties] Properties to set + */ + function IamPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IamPolicy policyBlob. + * @member {string} policyBlob + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @instance + */ + IamPolicy.prototype.policyBlob = ""; + + /** + * Creates a new IamPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy} IamPolicy instance + */ + IamPolicy.create = function create(properties) { + return new IamPolicy(properties); + }; + + /** + * Encodes the specified IamPolicy message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyBlob != null && Object.hasOwnProperty.call(message, "policyBlob")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.policyBlob); + return writer; + }; + + /** + * Encodes the specified IamPolicy message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.IIamPolicy} message IamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy} IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.policyBlob = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy} IamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicy message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + if (!$util.isString(message.policyBlob)) + return "policyBlob: string expected"; + return null; + }; + + /** + * Creates an IamPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy} IamPolicy + */ + IamPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy(); + if (object.policyBlob != null) + message.policyBlob = String(object.policyBlob); + return message; + }; + + /** + * Creates a plain object from an IamPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy} message IamPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.policyBlob = ""; + if (message.policyBlob != null && message.hasOwnProperty("policyBlob")) + object.policyBlob = message.policyBlob; + return object; + }; + + /** + * Converts this IamPolicy to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @instance + * @returns {Object.} JSON object + */ + IamPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IamPolicy + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy"; + }; + + return IamPolicy; + })(); + + return Asset; + })(); + + v1p1beta1.Folder = (function() { + + /** + * Properties of a Folder. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IFolder + * @property {string|null} [resourceFolder] Folder resourceFolder + * @property {string|null} [resourceFolderDisplayName] Folder resourceFolderDisplayName + */ + + /** + * Constructs a new Folder. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a Folder. + * @implements IFolder + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IFolder=} [properties] Properties to set + */ + function Folder(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Folder resourceFolder. + * @member {string} resourceFolder + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @instance + */ + Folder.prototype.resourceFolder = ""; + + /** + * Folder resourceFolderDisplayName. + * @member {string} resourceFolderDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @instance + */ + Folder.prototype.resourceFolderDisplayName = ""; + + /** + * Creates a new Folder instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IFolder=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Folder} Folder instance + */ + Folder.create = function create(properties) { + return new Folder(properties); + }; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Folder.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceFolder != null && Object.hasOwnProperty.call(message, "resourceFolder")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceFolder); + if (message.resourceFolderDisplayName != null && Object.hasOwnProperty.call(message, "resourceFolderDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceFolderDisplayName); + return writer; + }; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Folder.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.Folder(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resourceFolder = reader.string(); + break; + } + case 2: { + message.resourceFolderDisplayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Folder message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Folder.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceFolder != null && message.hasOwnProperty("resourceFolder")) + if (!$util.isString(message.resourceFolder)) + return "resourceFolder: string expected"; + if (message.resourceFolderDisplayName != null && message.hasOwnProperty("resourceFolderDisplayName")) + if (!$util.isString(message.resourceFolderDisplayName)) + return "resourceFolderDisplayName: string expected"; + return null; + }; + + /** + * Creates a Folder message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Folder} Folder + */ + Folder.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Folder) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.Folder(); + if (object.resourceFolder != null) + message.resourceFolder = String(object.resourceFolder); + if (object.resourceFolderDisplayName != null) + message.resourceFolderDisplayName = String(object.resourceFolderDisplayName); + return message; + }; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Folder} message Folder + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Folder.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceFolder = ""; + object.resourceFolderDisplayName = ""; + } + if (message.resourceFolder != null && message.hasOwnProperty("resourceFolder")) + object.resourceFolder = message.resourceFolder; + if (message.resourceFolderDisplayName != null && message.hasOwnProperty("resourceFolderDisplayName")) + object.resourceFolderDisplayName = message.resourceFolderDisplayName; + return object; + }; + + /** + * Converts this Folder to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @instance + * @returns {Object.} JSON object + */ + Folder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Folder + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.Folder + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Folder.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.Folder"; + }; + + return Folder; + })(); + + v1p1beta1.SecurityMarks = (function() { + + /** + * Properties of a SecurityMarks. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface ISecurityMarks + * @property {string|null} [name] SecurityMarks name + * @property {Object.|null} [marks] SecurityMarks marks + * @property {string|null} [canonicalName] SecurityMarks canonicalName + */ + + /** + * Constructs a new SecurityMarks. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a SecurityMarks. + * @implements ISecurityMarks + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.ISecurityMarks=} [properties] Properties to set + */ + function SecurityMarks(properties) { + this.marks = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityMarks name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.name = ""; + + /** + * SecurityMarks marks. + * @member {Object.} marks + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.marks = $util.emptyObject; + + /** + * SecurityMarks canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @instance + */ + SecurityMarks.prototype.canonicalName = ""; + + /** + * Creates a new SecurityMarks instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ISecurityMarks=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.SecurityMarks} SecurityMarks instance + */ + SecurityMarks.create = function create(properties) { + return new SecurityMarks(properties); + }; + + /** + * Encodes the specified SecurityMarks message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityMarks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.marks != null && Object.hasOwnProperty.call(message, "marks")) + for (var keys = Object.keys(message.marks), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.marks[keys[i]]).ldelim(); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.canonicalName); + return writer; + }; + + /** + * Encodes the specified SecurityMarks message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ISecurityMarks} message SecurityMarks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityMarks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityMarks.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.marks === $util.emptyObject) + message.marks = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.marks[key] = value; + break; + } + case 3: { + message.canonicalName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityMarks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.SecurityMarks} SecurityMarks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityMarks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityMarks message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityMarks.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.marks != null && message.hasOwnProperty("marks")) { + if (!$util.isObject(message.marks)) + return "marks: object expected"; + var key = Object.keys(message.marks); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.marks[key[i]])) + return "marks: string{k:string} expected"; + } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; + return null; + }; + + /** + * Creates a SecurityMarks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.SecurityMarks} SecurityMarks + */ + SecurityMarks.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks(); + if (object.name != null) + message.name = String(object.name); + if (object.marks) { + if (typeof object.marks !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.SecurityMarks.marks: object expected"); + message.marks = {}; + for (var keys = Object.keys(object.marks), i = 0; i < keys.length; ++i) + message.marks[keys[i]] = String(object.marks[keys[i]]); + } + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + return message; + }; + + /** + * Creates a plain object from a SecurityMarks message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @static + * @param {google.cloud.securitycenter.v1p1beta1.SecurityMarks} message SecurityMarks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityMarks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.marks = {}; + if (options.defaults) { + object.name = ""; + object.canonicalName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.marks && (keys2 = Object.keys(message.marks)).length) { + object.marks = {}; + for (var j = 0; j < keys2.length; ++j) + object.marks[keys2[j]] = message.marks[keys2[j]]; + } + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + return object; + }; + + /** + * Converts this SecurityMarks to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @instance + * @returns {Object.} JSON object + */ + SecurityMarks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityMarks + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityMarks + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityMarks.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.SecurityMarks"; + }; + + return SecurityMarks; + })(); + + v1p1beta1.Finding = (function() { + + /** + * Properties of a Finding. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [parent] Finding parent + * @property {string|null} [resourceName] Finding resourceName + * @property {google.cloud.securitycenter.v1p1beta1.Finding.State|null} [state] Finding state + * @property {string|null} [category] Finding category + * @property {string|null} [externalUri] Finding externalUri + * @property {Object.|null} [sourceProperties] Finding sourceProperties + * @property {google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null} [securityMarks] Finding securityMarks + * @property {google.protobuf.ITimestamp|null} [eventTime] Finding eventTime + * @property {google.protobuf.ITimestamp|null} [createTime] Finding createTime + * @property {google.cloud.securitycenter.v1p1beta1.Finding.Severity|null} [severity] Finding severity + * @property {string|null} [canonicalName] Finding canonicalName + */ + + /** + * Constructs a new Finding. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IFinding=} [properties] Properties to set + */ + function Finding(properties) { + this.sourceProperties = {}; + if (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.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.name = ""; + + /** + * Finding parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.parent = ""; + + /** + * Finding resourceName. + * @member {string} resourceName + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.resourceName = ""; + + /** + * Finding state. + * @member {google.cloud.securitycenter.v1p1beta1.Finding.State} state + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.state = 0; + + /** + * Finding category. + * @member {string} category + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.category = ""; + + /** + * Finding externalUri. + * @member {string} externalUri + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.externalUri = ""; + + /** + * Finding sourceProperties. + * @member {Object.} sourceProperties + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.sourceProperties = $util.emptyObject; + + /** + * Finding securityMarks. + * @member {google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.securityMarks = null; + + /** + * Finding eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.eventTime = null; + + /** + * Finding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.createTime = null; + + /** + * Finding severity. + * @member {google.cloud.securitycenter.v1p1beta1.Finding.Severity} severity + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.severity = 0; + + /** + * Finding canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @instance + */ + Finding.prototype.canonicalName = ""; + + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IFinding=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.category); + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.externalUri); + if (message.sourceProperties != null && Object.hasOwnProperty.call(message, "sourceProperties")) + for (var keys = Object.keys(message.sourceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.sourceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) + $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.severity); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); + return writer; + }; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.Finding(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.resourceName = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.category = reader.string(); + break; + } + case 6: { + message.externalUri = reader.string(); + break; + } + case 7: { + if (message.sourceProperties === $util.emptyObject) + message.sourceProperties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.sourceProperties[key] = value; + break; + } + case 8: { + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 9: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.severity = reader.int32(); + break; + } + case 14: { + message.canonicalName = reader.string(); + 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.securitycenter.v1p1beta1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.sourceProperties != null && message.hasOwnProperty("sourceProperties")) { + if (!$util.isObject(message.sourceProperties)) + return "sourceProperties: object expected"; + var key = Object.keys(message.sourceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.sourceProperties[key[i]]); + if (error) + return "sourceProperties." + error; + } + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + 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.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Finding) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.category != null) + message.category = String(object.category); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.sourceProperties) { + if (typeof object.sourceProperties !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Finding.sourceProperties: object expected"); + message.sourceProperties = {}; + for (var keys = Object.keys(object.sourceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.sourceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Finding.sourceProperties: object expected"); + message.sourceProperties[keys[i]] = $root.google.protobuf.Value.fromObject(object.sourceProperties[keys[i]]); + } + } + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Finding.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Finding.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Finding.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + 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.canonicalName != null) + message.canonicalName = String(object.canonicalName); + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.Finding + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.objects || options.defaults) + object.sourceProperties = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.resourceName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.category = ""; + object.externalUri = ""; + object.securityMarks = null; + object.eventTime = null; + object.createTime = null; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.canonicalName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1p1beta1.Finding.State[message.state] : message.state; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + var keys2; + if (message.sourceProperties && (keys2 = Object.keys(message.sourceProperties)).length) { + object.sourceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.sourceProperties[keys2[j]] = $root.google.protobuf.Value.toObject(message.sourceProperties[keys2[j]], options); + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.Finding.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.securitycenter.v1p1beta1.Finding.Severity[message.severity] : message.severity; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.Finding"; + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1p1beta1.Finding.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + */ + Finding.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + return values; + })(); + + /** + * Severity enum. + * @name google.cloud.securitycenter.v1p1beta1.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; + })(); + + v1p1beta1.NotificationConfig = (function() { + + /** + * Properties of a NotificationConfig. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface INotificationConfig + * @property {string|null} [name] NotificationConfig name + * @property {string|null} [description] NotificationConfig description + * @property {google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType|null} [eventType] NotificationConfig eventType + * @property {string|null} [pubsubTopic] NotificationConfig pubsubTopic + * @property {string|null} [serviceAccount] NotificationConfig serviceAccount + * @property {google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig|null} [streamingConfig] NotificationConfig streamingConfig + */ + + /** + * Constructs a new NotificationConfig. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a NotificationConfig. + * @implements INotificationConfig + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.INotificationConfig=} [properties] Properties to set + */ + function NotificationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationConfig name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.name = ""; + + /** + * NotificationConfig description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.description = ""; + + /** + * NotificationConfig eventType. + * @member {google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType} eventType + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.eventType = 0; + + /** + * NotificationConfig pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.pubsubTopic = ""; + + /** + * NotificationConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.serviceAccount = ""; + + /** + * NotificationConfig streamingConfig. + * @member {google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig|null|undefined} streamingConfig + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.streamingConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NotificationConfig notifyConfig. + * @member {"streamingConfig"|undefined} notifyConfig + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + */ + Object.defineProperty(NotificationConfig.prototype, "notifyConfig", { + get: $util.oneOfGetter($oneOfFields = ["streamingConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NotificationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.INotificationConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig} NotificationConfig instance + */ + NotificationConfig.create = function create(properties) { + return new NotificationConfig(properties); + }; + + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.eventType); + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pubsubTopic); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); + if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig")) + $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.encode(message.streamingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig} NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.eventType = reader.int32(); + break; + } + case 4: { + message.pubsubTopic = reader.string(); + break; + } + case 5: { + message.serviceAccount = reader.string(); + break; + } + case 6: { + message.streamingConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig} NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotificationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.eventType != null && message.hasOwnProperty("eventType")) + switch (message.eventType) { + default: + return "eventType: enum value expected"; + case 0: + case 1: + break; + } + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + properties.notifyConfig = 1; + { + var error = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.verify(message.streamingConfig); + if (error) + return "streamingConfig." + error; + } + } + return null; + }; + + /** + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig} NotificationConfig + */ + NotificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.eventType) { + default: + if (typeof object.eventType === "number") { + message.eventType = object.eventType; + break; + } + break; + case "EVENT_TYPE_UNSPECIFIED": + case 0: + message.eventType = 0; + break; + case "FINDING": + case 1: + message.eventType = 1; + break; + } + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.streamingConfig != null) { + if (typeof object.streamingConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.NotificationConfig.streamingConfig: object expected"); + message.streamingConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.fromObject(object.streamingConfig); + } + return message; + }; + + /** + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} message NotificationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.eventType = options.enums === String ? "EVENT_TYPE_UNSPECIFIED" : 0; + object.pubsubTopic = ""; + object.serviceAccount = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType[message.eventType] === undefined ? message.eventType : $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType[message.eventType] : message.eventType; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + object.streamingConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.toObject(message.streamingConfig, options); + if (options.oneofs) + object.notifyConfig = "streamingConfig"; + } + return object; + }; + + /** + * Converts this NotificationConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @instance + * @returns {Object.} JSON object + */ + NotificationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NotificationConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotificationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.NotificationConfig"; + }; + + NotificationConfig.StreamingConfig = (function() { + + /** + * Properties of a StreamingConfig. + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @interface IStreamingConfig + * @property {string|null} [filter] StreamingConfig filter + */ + + /** + * Constructs a new StreamingConfig. + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig + * @classdesc Represents a StreamingConfig. + * @implements IStreamingConfig + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig=} [properties] Properties to set + */ + function StreamingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingConfig filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @instance + */ + StreamingConfig.prototype.filter = ""; + + /** + * Creates a new StreamingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig} StreamingConfig instance + */ + StreamingConfig.create = function create(properties) { + return new StreamingConfig(properties); + }; + + /** + * Encodes the specified StreamingConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + return writer; + }; + + /** + * Encodes the specified StreamingConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig.IStreamingConfig} message StreamingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig} StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig} StreamingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a StreamingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig} StreamingConfig + */ + StreamingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig(); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a StreamingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig} message StreamingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.filter = ""; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this StreamingConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig"; + }; + + return StreamingConfig; + })(); + + /** + * EventType enum. + * @name google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType + * @enum {number} + * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value + * @property {number} FINDING=1 FINDING value + */ + NotificationConfig.EventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FINDING"] = 1; + return values; + })(); + + return NotificationConfig; + })(); + + v1p1beta1.NotificationMessage = (function() { + + /** + * Properties of a NotificationMessage. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface INotificationMessage + * @property {string|null} [notificationConfigName] NotificationMessage notificationConfigName + * @property {google.cloud.securitycenter.v1p1beta1.IFinding|null} [finding] NotificationMessage finding + * @property {google.cloud.securitycenter.v1p1beta1.IResource|null} [resource] NotificationMessage resource + */ + + /** + * Constructs a new NotificationMessage. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a NotificationMessage. + * @implements INotificationMessage + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.INotificationMessage=} [properties] Properties to set + */ + function NotificationMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationMessage notificationConfigName. + * @member {string} notificationConfigName + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @instance + */ + NotificationMessage.prototype.notificationConfigName = ""; + + /** + * NotificationMessage finding. + * @member {google.cloud.securitycenter.v1p1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @instance + */ + NotificationMessage.prototype.finding = null; + + /** + * NotificationMessage resource. + * @member {google.cloud.securitycenter.v1p1beta1.IResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @instance + */ + NotificationMessage.prototype.resource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NotificationMessage event. + * @member {"finding"|undefined} event + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @instance + */ + Object.defineProperty(NotificationMessage.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["finding"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NotificationMessage instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v1p1beta1.INotificationMessage=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationMessage} NotificationMessage instance + */ + NotificationMessage.create = function create(properties) { + return new NotificationMessage(properties); + }; + + /** + * Encodes the specified NotificationMessage message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v1p1beta1.INotificationMessage} message NotificationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notificationConfigName != null && Object.hasOwnProperty.call(message, "notificationConfigName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.notificationConfigName); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1p1beta1.Finding.encode(message.finding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.securitycenter.v1p1beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.NotificationMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v1p1beta1.INotificationMessage} message NotificationMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationMessage} NotificationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.NotificationMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.notificationConfigName = reader.string(); + break; + } + case 2: { + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resource = $root.google.cloud.securitycenter.v1p1beta1.Resource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationMessage} NotificationMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationMessage message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotificationMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + if (!$util.isString(message.notificationConfigName)) + return "notificationConfigName: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + properties.event = 1; + { + var error = $root.google.cloud.securitycenter.v1p1beta1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.NotificationMessage} NotificationMessage + */ + NotificationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.NotificationMessage) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.NotificationMessage(); + if (object.notificationConfigName != null) + message.notificationConfigName = String(object.notificationConfigName); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.NotificationMessage.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.fromObject(object.finding); + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.NotificationMessage.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v1p1beta1.Resource.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @param {google.cloud.securitycenter.v1p1beta1.NotificationMessage} message NotificationMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.notificationConfigName = ""; + object.resource = null; + } + if (message.notificationConfigName != null && message.hasOwnProperty("notificationConfigName")) + object.notificationConfigName = message.notificationConfigName; + if (message.finding != null && message.hasOwnProperty("finding")) { + object.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.toObject(message.finding, options); + if (options.oneofs) + object.event = "finding"; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v1p1beta1.Resource.toObject(message.resource, options); + return object; + }; + + /** + * Converts this NotificationMessage to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @instance + * @returns {Object.} JSON object + */ + NotificationMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NotificationMessage + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.NotificationMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotificationMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.NotificationMessage"; + }; + + return NotificationMessage; + })(); + + v1p1beta1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IResource + * @property {string|null} [name] Resource name + * @property {string|null} [project] Resource project + * @property {string|null} [projectDisplayName] Resource projectDisplayName + * @property {string|null} [parent] Resource parent + * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {Array.|null} [folders] Resource folders + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IResource=} [properties] Properties to set + */ + function Resource(properties) { + this.folders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + */ + Resource.prototype.name = ""; + + /** + * Resource project. + * @member {string} project + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + */ + Resource.prototype.project = ""; + + /** + * Resource projectDisplayName. + * @member {string} projectDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + */ + Resource.prototype.projectDisplayName = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + */ + Resource.prototype.parentDisplayName = ""; + + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.Folder.encode(message.folders[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.project = reader.string(); + break; + } + case 3: { + message.projectDisplayName = reader.string(); + break; + } + case 4: { + message.parent = reader.string(); + break; + } + case 5: { + message.parentDisplayName = reader.string(); + break; + } + case 7: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1p1beta1.Folder.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + if (!$util.isString(message.projectDisplayName)) + return "projectDisplayName: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (!$util.isString(message.parentDisplayName)) + return "parentDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Resource) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.Resource(); + if (object.name != null) + message.name = String(object.name); + if (object.project != null) + message.project = String(object.project); + if (object.projectDisplayName != null) + message.projectDisplayName = String(object.projectDisplayName); + if (object.parent != null) + message.parent = String(object.parent); + if (object.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Resource.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.Resource.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1p1beta1.Folder.fromObject(object.folders[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.folders = []; + if (options.defaults) { + object.name = ""; + object.project = ""; + object.projectDisplayName = ""; + object.parent = ""; + object.parentDisplayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + object.projectDisplayName = message.projectDisplayName; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + object.parentDisplayName = message.parentDisplayName; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1p1beta1.Folder.toObject(message.folders[j], options); + } + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.Resource"; + }; + + return Resource; + })(); + + v1p1beta1.OrganizationSettings = (function() { + + /** + * Properties of an OrganizationSettings. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IOrganizationSettings + * @property {string|null} [name] OrganizationSettings name + * @property {boolean|null} [enableAssetDiscovery] OrganizationSettings enableAssetDiscovery + * @property {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig|null} [assetDiscoveryConfig] OrganizationSettings assetDiscoveryConfig + */ + + /** + * Constructs a new OrganizationSettings. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an OrganizationSettings. + * @implements IOrganizationSettings + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings=} [properties] Properties to set + */ + function OrganizationSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OrganizationSettings name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.name = ""; + + /** + * OrganizationSettings enableAssetDiscovery. + * @member {boolean} enableAssetDiscovery + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.enableAssetDiscovery = false; + + /** + * OrganizationSettings assetDiscoveryConfig. + * @member {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig|null|undefined} assetDiscoveryConfig + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @instance + */ + OrganizationSettings.prototype.assetDiscoveryConfig = null; + + /** + * Creates a new OrganizationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} OrganizationSettings instance + */ + OrganizationSettings.create = function create(properties) { + return new OrganizationSettings(properties); + }; + + /** + * Encodes the specified OrganizationSettings message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.enableAssetDiscovery != null && Object.hasOwnProperty.call(message, "enableAssetDiscovery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableAssetDiscovery); + if (message.assetDiscoveryConfig != null && Object.hasOwnProperty.call(message, "assetDiscoveryConfig")) + $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.encode(message.assetDiscoveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OrganizationSettings message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings} message OrganizationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrganizationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.enableAssetDiscovery = reader.bool(); + break; + } + case 3: { + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrganizationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} OrganizationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrganizationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrganizationSettings message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrganizationSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + if (typeof message.enableAssetDiscovery !== "boolean") + return "enableAssetDiscovery: boolean expected"; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.verify(message.assetDiscoveryConfig); + if (error) + return "assetDiscoveryConfig." + error; + } + return null; + }; + + /** + * Creates an OrganizationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} OrganizationSettings + */ + OrganizationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableAssetDiscovery != null) + message.enableAssetDiscovery = Boolean(object.enableAssetDiscovery); + if (object.assetDiscoveryConfig != null) { + if (typeof object.assetDiscoveryConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.OrganizationSettings.assetDiscoveryConfig: object expected"); + message.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.fromObject(object.assetDiscoveryConfig); + } + return message; + }; + + /** + * Creates a plain object from an OrganizationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} message OrganizationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrganizationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.enableAssetDiscovery = false; + object.assetDiscoveryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableAssetDiscovery != null && message.hasOwnProperty("enableAssetDiscovery")) + object.enableAssetDiscovery = message.enableAssetDiscovery; + if (message.assetDiscoveryConfig != null && message.hasOwnProperty("assetDiscoveryConfig")) + object.assetDiscoveryConfig = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.toObject(message.assetDiscoveryConfig, options); + return object; + }; + + /** + * Converts this OrganizationSettings to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @instance + * @returns {Object.} JSON object + */ + OrganizationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrganizationSettings + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrganizationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.OrganizationSettings"; + }; + + OrganizationSettings.AssetDiscoveryConfig = (function() { + + /** + * Properties of an AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @interface IAssetDiscoveryConfig + * @property {Array.|null} [projectIds] AssetDiscoveryConfig projectIds + * @property {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode|null} [inclusionMode] AssetDiscoveryConfig inclusionMode + * @property {Array.|null} [folderIds] AssetDiscoveryConfig folderIds + */ + + /** + * Constructs a new AssetDiscoveryConfig. + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings + * @classdesc Represents an AssetDiscoveryConfig. + * @implements IAssetDiscoveryConfig + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + */ + function AssetDiscoveryConfig(properties) { + this.projectIds = []; + this.folderIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AssetDiscoveryConfig projectIds. + * @member {Array.} projectIds + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.projectIds = $util.emptyArray; + + /** + * AssetDiscoveryConfig inclusionMode. + * @member {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} inclusionMode + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.inclusionMode = 0; + + /** + * AssetDiscoveryConfig folderIds. + * @member {Array.} folderIds + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + */ + AssetDiscoveryConfig.prototype.folderIds = $util.emptyArray; + + /** + * Creates a new AssetDiscoveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig instance + */ + AssetDiscoveryConfig.create = function create(properties) { + return new AssetDiscoveryConfig(properties); + }; + + /** + * Encodes the specified AssetDiscoveryConfig message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectIds != null && message.projectIds.length) + for (var i = 0; i < message.projectIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectIds[i]); + if (message.inclusionMode != null && Object.hasOwnProperty.call(message, "inclusionMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inclusionMode); + if (message.folderIds != null && message.folderIds.length) + for (var i = 0; i < message.folderIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.folderIds[i]); + return writer; + }; + + /** + * Encodes the specified AssetDiscoveryConfig message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.IAssetDiscoveryConfig} message AssetDiscoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetDiscoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.projectIds && message.projectIds.length)) + message.projectIds = []; + message.projectIds.push(reader.string()); + break; + } + case 2: { + message.inclusionMode = reader.int32(); + break; + } + case 3: { + if (!(message.folderIds && message.folderIds.length)) + message.folderIds = []; + message.folderIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssetDiscoveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetDiscoveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssetDiscoveryConfig message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssetDiscoveryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectIds != null && message.hasOwnProperty("projectIds")) { + if (!Array.isArray(message.projectIds)) + return "projectIds: array expected"; + for (var i = 0; i < message.projectIds.length; ++i) + if (!$util.isString(message.projectIds[i])) + return "projectIds: string[] expected"; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + switch (message.inclusionMode) { + default: + return "inclusionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.folderIds != null && message.hasOwnProperty("folderIds")) { + if (!Array.isArray(message.folderIds)) + return "folderIds: array expected"; + for (var i = 0; i < message.folderIds.length; ++i) + if (!$util.isString(message.folderIds[i])) + return "folderIds: string[] expected"; + } + return null; + }; + + /** + * Creates an AssetDiscoveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig} AssetDiscoveryConfig + */ + AssetDiscoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig(); + if (object.projectIds) { + if (!Array.isArray(object.projectIds)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.projectIds: array expected"); + message.projectIds = []; + for (var i = 0; i < object.projectIds.length; ++i) + message.projectIds[i] = String(object.projectIds[i]); + } + switch (object.inclusionMode) { + default: + if (typeof object.inclusionMode === "number") { + message.inclusionMode = object.inclusionMode; + break; + } + break; + case "INCLUSION_MODE_UNSPECIFIED": + case 0: + message.inclusionMode = 0; + break; + case "INCLUDE_ONLY": + case 1: + message.inclusionMode = 1; + break; + case "EXCLUDE": + case 2: + message.inclusionMode = 2; + break; + } + if (object.folderIds) { + if (!Array.isArray(object.folderIds)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.folderIds: array expected"); + message.folderIds = []; + for (var i = 0; i < object.folderIds.length; ++i) + message.folderIds[i] = String(object.folderIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an AssetDiscoveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig} message AssetDiscoveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssetDiscoveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.projectIds = []; + object.folderIds = []; + } + if (options.defaults) + object.inclusionMode = options.enums === String ? "INCLUSION_MODE_UNSPECIFIED" : 0; + if (message.projectIds && message.projectIds.length) { + object.projectIds = []; + for (var j = 0; j < message.projectIds.length; ++j) + object.projectIds[j] = message.projectIds[j]; + } + if (message.inclusionMode != null && message.hasOwnProperty("inclusionMode")) + object.inclusionMode = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] === undefined ? message.inclusionMode : $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode[message.inclusionMode] : message.inclusionMode; + if (message.folderIds && message.folderIds.length) { + object.folderIds = []; + for (var j = 0; j < message.folderIds.length; ++j) + object.folderIds[j] = message.folderIds[j]; + } + return object; + }; + + /** + * Converts this AssetDiscoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @instance + * @returns {Object.} JSON object + */ + AssetDiscoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AssetDiscoveryConfig + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssetDiscoveryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig"; + }; + + /** + * InclusionMode enum. + * @name google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + * @enum {number} + * @property {number} INCLUSION_MODE_UNSPECIFIED=0 INCLUSION_MODE_UNSPECIFIED value + * @property {number} INCLUDE_ONLY=1 INCLUDE_ONLY value + * @property {number} EXCLUDE=2 EXCLUDE value + */ + AssetDiscoveryConfig.InclusionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCLUSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCLUDE_ONLY"] = 1; + values[valuesById[2] = "EXCLUDE"] = 2; + return values; + })(); + + return AssetDiscoveryConfig; + })(); + + return OrganizationSettings; + })(); + + v1p1beta1.RunAssetDiscoveryResponse = (function() { + + /** + * Properties of a RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IRunAssetDiscoveryResponse + * @property {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State|null} [state] RunAssetDiscoveryResponse state + * @property {google.protobuf.IDuration|null} [duration] RunAssetDiscoveryResponse duration + */ + + /** + * Constructs a new RunAssetDiscoveryResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a RunAssetDiscoveryResponse. + * @implements IRunAssetDiscoveryResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set + */ + function RunAssetDiscoveryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunAssetDiscoveryResponse state. + * @member {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State} state + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.state = 0; + + /** + * RunAssetDiscoveryResponse duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @instance + */ + RunAssetDiscoveryResponse.prototype.duration = null; + + /** + * Creates a new RunAssetDiscoveryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse instance + */ + RunAssetDiscoveryResponse.create = function create(properties) { + return new RunAssetDiscoveryResponse(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunAssetDiscoveryResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse} message RunAssetDiscoveryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAssetDiscoveryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates a RunAssetDiscoveryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} RunAssetDiscoveryResponse + */ + RunAssetDiscoveryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "COMPLETED": + case 1: + message.state = 1; + break; + case "SUPERSEDED": + case 2: + message.state = 2; + break; + case "TERMINATED": + case 3: + message.state = 3; + break; + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse} message RunAssetDiscoveryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.duration = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State[message.state] : message.state; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this RunAssetDiscoveryResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunAssetDiscoveryResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAssetDiscoveryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse"; + }; + + /** + * State enum. + * @name google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} COMPLETED=1 COMPLETED value + * @property {number} SUPERSEDED=2 SUPERSEDED value + * @property {number} TERMINATED=3 TERMINATED value + */ + RunAssetDiscoveryResponse.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPLETED"] = 1; + values[valuesById[2] = "SUPERSEDED"] = 2; + values[valuesById[3] = "TERMINATED"] = 3; + return values; + })(); + + return RunAssetDiscoveryResponse; + })(); + + v1p1beta1.SecurityCenter = (function() { + + /** + * Constructs a new SecurityCenter service. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a SecurityCenter + * @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 SecurityCenter(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityCenter.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityCenter; + + /** + * Creates new SecurityCenter service using the specified rpc implementation. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @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 {SecurityCenter} RPC service. Useful where requests and/or responses are streamed. + */ + SecurityCenter.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|createSource}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.Source} [response] Source + */ + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest, $root.google.cloud.securitycenter.v1p1beta1.Source, request, callback); + }, "name", { value: "CreateSource" }); + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|createFinding}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef CreateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.Finding} [response] Finding + */ + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createFinding = function createFinding(request, callback) { + return this.rpcCall(createFinding, $root.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest, $root.google.cloud.securitycenter.v1p1beta1.Finding, request, callback); + }, "name", { value: "CreateFinding" }); + + /** + * Calls CreateFinding. + * @function createFinding + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest} request CreateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|createNotificationConfig}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef CreateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.createNotificationConfig = function createNotificationConfig(request, callback) { + return this.rpcCall(createNotificationConfig, $root.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest, $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig, request, callback); + }, "name", { value: "CreateNotificationConfig" }); + + /** + * Calls CreateNotificationConfig. + * @function createNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest} request CreateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|deleteNotificationConfig}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef DeleteNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteNotificationConfig. + * @function deleteNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.deleteNotificationConfig = function deleteNotificationConfig(request, callback) { + return this.rpcCall(deleteNotificationConfig, $root.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteNotificationConfig" }); + + /** + * Calls DeleteNotificationConfig. + * @function deleteNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest} request DeleteNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getIamPolicy}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getNotificationConfig}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef GetNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getNotificationConfig = function getNotificationConfig(request, callback) { + return this.rpcCall(getNotificationConfig, $root.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest, $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig, request, callback); + }, "name", { value: "GetNotificationConfig" }); + + /** + * Calls GetNotificationConfig. + * @function getNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest} request GetNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef GetOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getOrganizationSettings = function getOrganizationSettings(request, callback) { + return this.rpcCall(getOrganizationSettings, $root.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings, request, callback); + }, "name", { value: "GetOrganizationSettings" }); + + /** + * Calls GetOrganizationSettings. + * @function getOrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest} request GetOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|getSource}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.Source} [response] Source + */ + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.securitycenter.v1p1beta1.GetSourceRequest, $root.google.cloud.securitycenter.v1p1beta1.Source, request, callback); + }, "name", { value: "GetSource" }); + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|groupAssets}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef GroupAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} [response] GroupAssetsResponse + */ + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssetsCallback} callback Node-style callback called with the error, if any, and GroupAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupAssets = function groupAssets(request, callback) { + return this.rpcCall(groupAssets, $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest, $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse, request, callback); + }, "name", { value: "GroupAssets" }); + + /** + * Calls GroupAssets. + * @function groupAssets + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest} request GroupAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|groupFindings}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef GroupFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} [response] GroupFindingsResponse + */ + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindingsCallback} callback Node-style callback called with the error, if any, and GroupFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.groupFindings = function groupFindings(request, callback) { + return this.rpcCall(groupFindings, $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest, $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse, request, callback); + }, "name", { value: "GroupFindings" }); + + /** + * Calls GroupFindings. + * @function groupFindings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest} request GroupFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listAssets}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest, $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listFindings}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} [response] ListFindingsResponse + */ + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest, $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listNotificationConfigs}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef ListNotificationConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} [response] ListNotificationConfigsResponse + */ + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigsCallback} callback Node-style callback called with the error, if any, and ListNotificationConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listNotificationConfigs = function listNotificationConfigs(request, callback) { + return this.rpcCall(listNotificationConfigs, $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest, $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse, request, callback); + }, "name", { value: "ListNotificationConfigs" }); + + /** + * Calls ListNotificationConfigs. + * @function listNotificationConfigs + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest} request ListNotificationConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|listSources}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} [response] ListSourcesResponse + */ + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest, $root.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|runAssetDiscovery}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef RunAssetDiscoveryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscoveryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.runAssetDiscovery = function runAssetDiscovery(request, callback) { + return this.rpcCall(runAssetDiscovery, $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunAssetDiscovery" }); + + /** + * Calls RunAssetDiscovery. + * @function runAssetDiscovery + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest} request RunAssetDiscoveryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|setFindingState}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef SetFindingStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.Finding} [response] Finding + */ + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingStateCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setFindingState = function setFindingState(request, callback) { + return this.rpcCall(setFindingState, $root.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest, $root.google.cloud.securitycenter.v1p1beta1.Finding, request, callback); + }, "name", { value: "SetFindingState" }); + + /** + * Calls SetFindingState. + * @function setFindingState + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest} request SetFindingStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|setIamPolicy}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|testIamPermissions}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateFinding}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef UpdateFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.Finding} [response] Finding + */ + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateFinding = function updateFinding(request, callback) { + return this.rpcCall(updateFinding, $root.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest, $root.google.cloud.securitycenter.v1p1beta1.Finding, request, callback); + }, "name", { value: "UpdateFinding" }); + + /** + * Calls UpdateFinding. + * @function updateFinding + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest} request UpdateFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateNotificationConfig}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef UpdateNotificationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} [response] NotificationConfig + */ + + /** + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfigCallback} callback Node-style callback called with the error, if any, and NotificationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateNotificationConfig = function updateNotificationConfig(request, callback) { + return this.rpcCall(updateNotificationConfig, $root.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest, $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig, request, callback); + }, "name", { value: "UpdateNotificationConfig" }); + + /** + * Calls UpdateNotificationConfig. + * @function updateNotificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest} request UpdateNotificationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateOrganizationSettings}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef UpdateOrganizationSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} [response] OrganizationSettings + */ + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettingsCallback} callback Node-style callback called with the error, if any, and OrganizationSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateOrganizationSettings = function updateOrganizationSettings(request, callback) { + return this.rpcCall(updateOrganizationSettings, $root.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest, $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings, request, callback); + }, "name", { value: "UpdateOrganizationSettings" }); + + /** + * Calls UpdateOrganizationSettings. + * @function updateOrganizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest} request UpdateOrganizationSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateSource}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.Source} [response] Source + */ + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest, $root.google.cloud.securitycenter.v1p1beta1.Source, request, callback); + }, "name", { value: "UpdateSource" }); + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.securitycenter.v1p1beta1.SecurityCenter|updateSecurityMarks}. + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @typedef UpdateSecurityMarksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.securitycenter.v1p1beta1.SecurityMarks} [response] SecurityMarks + */ + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @param {google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarksCallback} callback Node-style callback called with the error, if any, and SecurityMarks + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityCenter.prototype.updateSecurityMarks = function updateSecurityMarks(request, callback) { + return this.rpcCall(updateSecurityMarks, $root.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest, $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks, request, callback); + }, "name", { value: "UpdateSecurityMarks" }); + + /** + * Calls UpdateSecurityMarks. + * @function updateSecurityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.SecurityCenter + * @instance + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest} request UpdateSecurityMarksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecurityCenter; + })(); + + v1p1beta1.CreateFindingRequest = (function() { + + /** + * Properties of a CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface ICreateFindingRequest + * @property {string|null} [parent] CreateFindingRequest parent + * @property {string|null} [findingId] CreateFindingRequest findingId + * @property {google.cloud.securitycenter.v1p1beta1.IFinding|null} [finding] CreateFindingRequest finding + */ + + /** + * Constructs a new CreateFindingRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a CreateFindingRequest. + * @implements ICreateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest=} [properties] Properties to set + */ + function CreateFindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateFindingRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.parent = ""; + + /** + * CreateFindingRequest findingId. + * @member {string} findingId + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.findingId = ""; + + /** + * CreateFindingRequest finding. + * @member {google.cloud.securitycenter.v1p1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @instance + */ + CreateFindingRequest.prototype.finding = null; + + /** + * Creates a new CreateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} CreateFindingRequest instance + */ + CreateFindingRequest.create = function create(properties) { + return new CreateFindingRequest(properties); + }; + + /** + * Encodes the specified CreateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.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.findingId != null && Object.hasOwnProperty.call(message, "findingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingId); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1p1beta1.Finding.encode(message.finding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest} message CreateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.findingId = reader.string(); + break; + } + case 3: { + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} CreateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFindingRequest.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.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + return null; + }; + + /** + * Creates a CreateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} CreateFindingRequest + */ + CreateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.findingId != null) + message.findingId = String(object.findingId); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.CreateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.fromObject(object.finding); + } + return message; + }; + + /** + * Creates a plain object from a CreateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.CreateFindingRequest} message CreateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.findingId = ""; + object.finding = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.toObject(message.finding, options); + return object; + }; + + /** + * Converts this CreateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.CreateFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.CreateFindingRequest"; + }; + + return CreateFindingRequest; + })(); + + v1p1beta1.CreateNotificationConfigRequest = (function() { + + /** + * Properties of a CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface ICreateNotificationConfigRequest + * @property {string|null} [parent] CreateNotificationConfigRequest parent + * @property {string|null} [configId] CreateNotificationConfigRequest configId + * @property {google.cloud.securitycenter.v1p1beta1.INotificationConfig|null} [notificationConfig] CreateNotificationConfigRequest notificationConfig + */ + + /** + * Constructs a new CreateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a CreateNotificationConfigRequest. + * @implements ICreateNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest=} [properties] Properties to set + */ + function CreateNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateNotificationConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.parent = ""; + + /** + * CreateNotificationConfigRequest configId. + * @member {string} configId + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.configId = ""; + + /** + * CreateNotificationConfigRequest notificationConfig. + * @member {google.cloud.securitycenter.v1p1beta1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @instance + */ + CreateNotificationConfigRequest.prototype.notificationConfig = null; + + /** + * Creates a new CreateNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest} CreateNotificationConfigRequest instance + */ + CreateNotificationConfigRequest.create = function create(properties) { + return new CreateNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified CreateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateNotificationConfigRequest.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.configId != null && Object.hasOwnProperty.call(message, "configId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest} message CreateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateNotificationConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.configId = reader.string(); + break; + } + case 3: { + message.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateNotificationConfigRequest.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.configId != null && message.hasOwnProperty("configId")) + if (!$util.isString(message.configId)) + return "configId: string expected"; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + return null; + }; + + /** + * Creates a CreateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest} CreateNotificationConfigRequest + */ + CreateNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.configId != null) + message.configId = String(object.configId); + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.fromObject(object.notificationConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest} message CreateNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateNotificationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.configId = ""; + object.notificationConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.configId != null && message.hasOwnProperty("configId")) + object.configId = message.configId; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.toObject(message.notificationConfig, options); + return object; + }; + + /** + * Converts this CreateNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest"; + }; + + return CreateNotificationConfigRequest; + })(); + + v1p1beta1.CreateSourceRequest = (function() { + + /** + * Properties of a CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {google.cloud.securitycenter.v1p1beta1.ISource|null} [source] CreateSourceRequest source + */ + + /** + * Constructs a new CreateSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest=} [properties] Properties to set + */ + function CreateSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.parent = ""; + + /** + * CreateSourceRequest source. + * @member {google.cloud.securitycenter.v1p1beta1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.source = null; + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} CreateSourceRequest instance + */ + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); + }; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.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.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.securitycenter.v1p1beta1.Source.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.source = $root.google.cloud.securitycenter.v1p1beta1.Source.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSourceRequest.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.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Source.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; + + /** + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} CreateSourceRequest + */ + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1p1beta1.Source.fromObject(object.source); + } + return message; + }; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.CreateSourceRequest} message CreateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.source = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1p1beta1.Source.toObject(message.source, options); + return object; + }; + + /** + * Converts this CreateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.CreateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.CreateSourceRequest"; + }; + + return CreateSourceRequest; + })(); + + v1p1beta1.DeleteNotificationConfigRequest = (function() { + + /** + * Properties of a DeleteNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IDeleteNotificationConfigRequest + * @property {string|null} [name] DeleteNotificationConfigRequest name + */ + + /** + * Constructs a new DeleteNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a DeleteNotificationConfigRequest. + * @implements IDeleteNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest=} [properties] Properties to set + */ + function DeleteNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @instance + */ + DeleteNotificationConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest instance + */ + DeleteNotificationConfigRequest.create = function create(properties) { + return new DeleteNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNotificationConfigRequest.encode = function encode(message, writer) { + 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 DeleteNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest} message DeleteNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNotificationConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest(); + 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 DeleteNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteNotificationConfigRequest.verify = function verify(message) { + if (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 DeleteNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest} DeleteNotificationConfigRequest + */ + DeleteNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest} message DeleteNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteNotificationConfigRequest.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 DeleteNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest"; + }; + + return DeleteNotificationConfigRequest; + })(); + + v1p1beta1.GetNotificationConfigRequest = (function() { + + /** + * Properties of a GetNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGetNotificationConfigRequest + * @property {string|null} [name] GetNotificationConfigRequest name + */ + + /** + * Constructs a new GetNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GetNotificationConfigRequest. + * @implements IGetNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest=} [properties] Properties to set + */ + function GetNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNotificationConfigRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @instance + */ + GetNotificationConfigRequest.prototype.name = ""; + + /** + * Creates a new GetNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest} GetNotificationConfigRequest instance + */ + GetNotificationConfigRequest.create = function create(properties) { + return new GetNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified GetNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNotificationConfigRequest.encode = function encode(message, writer) { + 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 GetNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest} message GetNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNotificationConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest(); + 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 GetNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest} GetNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNotificationConfigRequest.verify = function verify(message) { + if (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 GetNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest} GetNotificationConfigRequest + */ + GetNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest} message GetNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNotificationConfigRequest.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 GetNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest"; + }; + + return GetNotificationConfigRequest; + })(); + + v1p1beta1.GetOrganizationSettingsRequest = (function() { + + /** + * Properties of a GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGetOrganizationSettingsRequest + * @property {string|null} [name] GetOrganizationSettingsRequest name + */ + + /** + * Constructs a new GetOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GetOrganizationSettingsRequest. + * @implements IGetOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set + */ + function GetOrganizationSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOrganizationSettingsRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @instance + */ + GetOrganizationSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest instance + */ + GetOrganizationSettingsRequest.create = function create(properties) { + return new GetOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified GetOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationSettingsRequest.encode = function encode(message, writer) { + 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 GetOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest} message GetOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationSettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest(); + 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 GetOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOrganizationSettingsRequest.verify = function verify(message) { + if (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 GetOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest} GetOrganizationSettingsRequest + */ + GetOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest} message GetOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOrganizationSettingsRequest.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 GetOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOrganizationSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOrganizationSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest"; + }; + + return GetOrganizationSettingsRequest; + })(); + + v1p1beta1.GetSourceRequest = (function() { + + /** + * Properties of a GetSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name + */ + + /** + * Constructs a new GetSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IGetSourceRequest=} [properties] Properties to set + */ + function GetSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSourceRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @instance + */ + GetSourceRequest.prototype.name = ""; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GetSourceRequest} GetSourceRequest instance + */ + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); + }; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.encode = function encode(message, writer) { + 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 GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GetSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GetSourceRequest(); + 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 GetSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSourceRequest.verify = function verify(message) { + if (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 GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GetSourceRequest} GetSourceRequest + */ + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GetSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.GetSourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.GetSourceRequest} message GetSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSourceRequest.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 GetSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GetSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GetSourceRequest"; + }; + + return GetSourceRequest; + })(); + + v1p1beta1.GroupAssetsRequest = (function() { + + /** + * Properties of a GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGroupAssetsRequest + * @property {string|null} [parent] GroupAssetsRequest parent + * @property {string|null} [filter] GroupAssetsRequest filter + * @property {string|null} [groupBy] GroupAssetsRequest groupBy + * @property {google.protobuf.IDuration|null} [compareDuration] GroupAssetsRequest compareDuration + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsRequest readTime + * @property {string|null} [pageToken] GroupAssetsRequest pageToken + * @property {number|null} [pageSize] GroupAssetsRequest pageSize + */ + + /** + * Constructs a new GroupAssetsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupAssetsRequest. + * @implements IGroupAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest=} [properties] Properties to set + */ + function GroupAssetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.parent = ""; + + /** + * GroupAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.filter = ""; + + /** + * GroupAssetsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.groupBy = ""; + + /** + * GroupAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.compareDuration = null; + + /** + * GroupAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.readTime = null; + + /** + * GroupAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageToken = ""; + + /** + * GroupAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + */ + GroupAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} GroupAssetsRequest instance + */ + GroupAssetsRequest.create = function create(properties) { + return new GroupAssetsRequest(properties); + }; + + /** + * Encodes the specified GroupAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsRequest.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.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified GroupAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest} message GroupAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest(); + 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.groupBy = reader.string(); + break; + } + case 4: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} GroupAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupAssetsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupAssetsRequest.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.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + 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 GroupAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} GroupAssetsRequest + */ + GroupAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + 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 GroupAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest} message GroupAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.compareDuration = null; + object.readTime = null; + 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.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + 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 GroupAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest"; + }; + + return GroupAssetsRequest; + })(); + + v1p1beta1.GroupAssetsResponse = (function() { + + /** + * Properties of a GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGroupAssetsResponse + * @property {Array.|null} [groupByResults] GroupAssetsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupAssetsResponse readTime + * @property {string|null} [nextPageToken] GroupAssetsResponse nextPageToken + * @property {number|null} [totalSize] GroupAssetsResponse totalSize + */ + + /** + * Constructs a new GroupAssetsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupAssetsResponse. + * @implements IGroupAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse=} [properties] Properties to set + */ + function GroupAssetsResponse(properties) { + this.groupByResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupAssetsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.readTime = null; + + /** + * GroupAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.nextPageToken = ""; + + /** + * GroupAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @instance + */ + GroupAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} GroupAssetsResponse instance + */ + GroupAssetsResponse.create = function create(properties) { + return new GroupAssetsResponse(properties); + }; + + /** + * Encodes the specified GroupAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified GroupAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse} message GroupAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1p1beta1.GroupResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} GroupAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupAssetsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a GroupAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} GroupAssetsResponse + */ + GroupAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1p1beta1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse} message GroupAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1p1beta1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this GroupAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse"; + }; + + return GroupAssetsResponse; + })(); + + v1p1beta1.GroupFindingsRequest = (function() { + + /** + * Properties of a GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGroupFindingsRequest + * @property {string|null} [parent] GroupFindingsRequest parent + * @property {string|null} [filter] GroupFindingsRequest filter + * @property {string|null} [groupBy] GroupFindingsRequest groupBy + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] GroupFindingsRequest compareDuration + * @property {string|null} [pageToken] GroupFindingsRequest pageToken + * @property {number|null} [pageSize] GroupFindingsRequest pageSize + */ + + /** + * Constructs a new GroupFindingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupFindingsRequest. + * @implements IGroupFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest=} [properties] Properties to set + */ + function GroupFindingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.parent = ""; + + /** + * GroupFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.filter = ""; + + /** + * GroupFindingsRequest groupBy. + * @member {string} groupBy + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.groupBy = ""; + + /** + * GroupFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.readTime = null; + + /** + * GroupFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.compareDuration = null; + + /** + * GroupFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageToken = ""; + + /** + * GroupFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + */ + GroupFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new GroupFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} GroupFindingsRequest instance + */ + GroupFindingsRequest.create = function create(properties) { + return new GroupFindingsRequest(properties); + }; + + /** + * Encodes the specified GroupFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsRequest.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.groupBy != null && Object.hasOwnProperty.call(message, "groupBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupBy); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified GroupFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest} message GroupFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest(); + 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.groupBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} GroupFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupFindingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupFindingsRequest.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.groupBy != null && message.hasOwnProperty("groupBy")) + if (!$util.isString(message.groupBy)) + return "groupBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + 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 GroupFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} GroupFindingsRequest + */ + GroupFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.groupBy != null) + message.groupBy = String(object.groupBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + 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 GroupFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest} message GroupFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.groupBy = ""; + object.readTime = null; + object.compareDuration = null; + 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.groupBy != null && message.hasOwnProperty("groupBy")) + object.groupBy = message.groupBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + 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 GroupFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest"; + }; + + return GroupFindingsRequest; + })(); + + v1p1beta1.GroupFindingsResponse = (function() { + + /** + * Properties of a GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGroupFindingsResponse + * @property {Array.|null} [groupByResults] GroupFindingsResponse groupByResults + * @property {google.protobuf.ITimestamp|null} [readTime] GroupFindingsResponse readTime + * @property {string|null} [nextPageToken] GroupFindingsResponse nextPageToken + * @property {number|null} [totalSize] GroupFindingsResponse totalSize + */ + + /** + * Constructs a new GroupFindingsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupFindingsResponse. + * @implements IGroupFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse=} [properties] Properties to set + */ + function GroupFindingsResponse(properties) { + this.groupByResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupFindingsResponse groupByResults. + * @member {Array.} groupByResults + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.groupByResults = $util.emptyArray; + + /** + * GroupFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.readTime = null; + + /** + * GroupFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.nextPageToken = ""; + + /** + * GroupFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @instance + */ + GroupFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new GroupFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} GroupFindingsResponse instance + */ + GroupFindingsResponse.create = function create(properties) { + return new GroupFindingsResponse(properties); + }; + + /** + * Encodes the specified GroupFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupByResults != null && message.groupByResults.length) + for (var i = 0; i < message.groupByResults.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.GroupResult.encode(message.groupByResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified GroupFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse} message GroupFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.groupByResults && message.groupByResults.length)) + message.groupByResults = []; + message.groupByResults.push($root.google.cloud.securitycenter.v1p1beta1.GroupResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} GroupFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupFindingsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupByResults != null && message.hasOwnProperty("groupByResults")) { + if (!Array.isArray(message.groupByResults)) + return "groupByResults: array expected"; + for (var i = 0; i < message.groupByResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.GroupResult.verify(message.groupByResults[i]); + if (error) + return "groupByResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a GroupFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} GroupFindingsResponse + */ + GroupFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse(); + if (object.groupByResults) { + if (!Array.isArray(object.groupByResults)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.groupByResults: array expected"); + message.groupByResults = []; + for (var i = 0; i < object.groupByResults.length; ++i) { + if (typeof object.groupByResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.groupByResults: object expected"); + message.groupByResults[i] = $root.google.cloud.securitycenter.v1p1beta1.GroupResult.fromObject(object.groupByResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a GroupFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse} message GroupFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.groupByResults && message.groupByResults.length) { + object.groupByResults = []; + for (var j = 0; j < message.groupByResults.length; ++j) + object.groupByResults[j] = $root.google.cloud.securitycenter.v1p1beta1.GroupResult.toObject(message.groupByResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this GroupFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + GroupFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse"; + }; + + return GroupFindingsResponse; + })(); + + v1p1beta1.GroupResult = (function() { + + /** + * Properties of a GroupResult. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IGroupResult + * @property {Object.|null} [properties] GroupResult properties + * @property {number|Long|null} [count] GroupResult count + */ + + /** + * Constructs a new GroupResult. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a GroupResult. + * @implements IGroupResult + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IGroupResult=} [properties] Properties to set + */ + function GroupResult(properties) { + this.properties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupResult properties. + * @member {Object.} properties + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @instance + */ + GroupResult.prototype.properties = $util.emptyObject; + + /** + * GroupResult count. + * @member {number|Long} count + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @instance + */ + GroupResult.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new GroupResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.GroupResult} GroupResult instance + */ + GroupResult.create = function create(properties) { + return new GroupResult(properties); + }; + + /** + * Encodes the specified GroupResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupResult} message GroupResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified GroupResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.GroupResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IGroupResult} message GroupResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.GroupResult} GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.GroupResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.properties === $util.emptyObject) + message.properties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; + break; + } + case 2: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.GroupResult} GroupResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a GroupResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.GroupResult} GroupResult + */ + GroupResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.GroupResult) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.GroupResult(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupResult.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.GroupResult.properties: object expected"); + message.properties[keys[i]] = $root.google.protobuf.Value.fromObject(object.properties[keys[i]]); + } + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GroupResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.GroupResult} message GroupResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.protobuf.Value.toObject(message.properties[keys2[j]], options); + } + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this GroupResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @instance + * @returns {Object.} JSON object + */ + GroupResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.GroupResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.GroupResult"; + }; + + return GroupResult; + })(); + + v1p1beta1.ListNotificationConfigsRequest = (function() { + + /** + * Properties of a ListNotificationConfigsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListNotificationConfigsRequest + * @property {string|null} [parent] ListNotificationConfigsRequest parent + * @property {string|null} [pageToken] ListNotificationConfigsRequest pageToken + * @property {number|null} [pageSize] ListNotificationConfigsRequest pageSize + */ + + /** + * Constructs a new ListNotificationConfigsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListNotificationConfigsRequest. + * @implements IListNotificationConfigsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest=} [properties] Properties to set + */ + function ListNotificationConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNotificationConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.parent = ""; + + /** + * ListNotificationConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.pageToken = ""; + + /** + * ListNotificationConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @instance + */ + ListNotificationConfigsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListNotificationConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest instance + */ + ListNotificationConfigsRequest.create = function create(properties) { + return new ListNotificationConfigsRequest(properties); + }; + + /** + * Encodes the specified ListNotificationConfigsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest} message ListNotificationConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNotificationConfigsRequest.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 ListNotificationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest} message ListNotificationConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNotificationConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNotificationConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest(); + 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 ListNotificationConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNotificationConfigsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNotificationConfigsRequest.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 ListNotificationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} ListNotificationConfigsRequest + */ + ListNotificationConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest(); + 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 ListNotificationConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest} message ListNotificationConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNotificationConfigsRequest.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 ListNotificationConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListNotificationConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListNotificationConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNotificationConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest"; + }; + + return ListNotificationConfigsRequest; + })(); + + v1p1beta1.ListNotificationConfigsResponse = (function() { + + /** + * Properties of a ListNotificationConfigsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListNotificationConfigsResponse + * @property {Array.|null} [notificationConfigs] ListNotificationConfigsResponse notificationConfigs + * @property {string|null} [nextPageToken] ListNotificationConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListNotificationConfigsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListNotificationConfigsResponse. + * @implements IListNotificationConfigsResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse=} [properties] Properties to set + */ + function ListNotificationConfigsResponse(properties) { + this.notificationConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNotificationConfigsResponse notificationConfigs. + * @member {Array.} notificationConfigs + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @instance + */ + ListNotificationConfigsResponse.prototype.notificationConfigs = $util.emptyArray; + + /** + * ListNotificationConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @instance + */ + ListNotificationConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListNotificationConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} ListNotificationConfigsResponse instance + */ + ListNotificationConfigsResponse.create = function create(properties) { + return new ListNotificationConfigsResponse(properties); + }; + + /** + * Encodes the specified ListNotificationConfigsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse} message ListNotificationConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNotificationConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notificationConfigs != null && message.notificationConfigs.length) + for (var i = 0; i < message.notificationConfigs.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.encode(message.notificationConfigs[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 ListNotificationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse} message ListNotificationConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNotificationConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} ListNotificationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.notificationConfigs && message.notificationConfigs.length)) + message.notificationConfigs = []; + message.notificationConfigs.push($root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNotificationConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} ListNotificationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNotificationConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNotificationConfigsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNotificationConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notificationConfigs != null && message.hasOwnProperty("notificationConfigs")) { + if (!Array.isArray(message.notificationConfigs)) + return "notificationConfigs: array expected"; + for (var i = 0; i < message.notificationConfigs.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify(message.notificationConfigs[i]); + if (error) + return "notificationConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListNotificationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} ListNotificationConfigsResponse + */ + ListNotificationConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse(); + if (object.notificationConfigs) { + if (!Array.isArray(object.notificationConfigs)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.notificationConfigs: array expected"); + message.notificationConfigs = []; + for (var i = 0; i < object.notificationConfigs.length; ++i) { + if (typeof object.notificationConfigs[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse.notificationConfigs: object expected"); + message.notificationConfigs[i] = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.fromObject(object.notificationConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListNotificationConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse} message ListNotificationConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNotificationConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.notificationConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.notificationConfigs && message.notificationConfigs.length) { + object.notificationConfigs = []; + for (var j = 0; j < message.notificationConfigs.length; ++j) + object.notificationConfigs[j] = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.toObject(message.notificationConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListNotificationConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListNotificationConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListNotificationConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNotificationConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse"; + }; + + return ListNotificationConfigsResponse; + })(); + + v1p1beta1.ListSourcesRequest = (function() { + + /** + * Properties of a ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListSourcesRequest + * @property {string|null} [parent] ListSourcesRequest parent + * @property {string|null} [pageToken] ListSourcesRequest pageToken + * @property {number|null} [pageSize] ListSourcesRequest pageSize + */ + + /** + * Constructs a new ListSourcesRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListSourcesRequest. + * @implements IListSourcesRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest=} [properties] Properties to set + */ + function ListSourcesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.parent = ""; + + /** + * ListSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageToken = ""; + + /** + * ListSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} ListSourcesRequest instance + */ + ListSourcesRequest.create = function create(properties) { + return new ListSourcesRequest(properties); + }; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.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 7, wireType 0 =*/56).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest(); + 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 7: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesRequest.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 ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} ListSourcesRequest + */ + ListSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest(); + 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 ListSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListSourcesRequest} message ListSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesRequest.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 ListSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListSourcesRequest"; + }; + + return ListSourcesRequest; + })(); + + v1p1beta1.ListSourcesResponse = (function() { + + /** + * Properties of a ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListSourcesResponse + * @property {Array.|null} [sources] ListSourcesResponse sources + * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken + */ + + /** + * Constructs a new ListSourcesResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListSourcesResponse. + * @implements IListSourcesResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesResponse=} [properties] Properties to set + */ + function ListSourcesResponse(properties) { + this.sources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSourcesResponse sources. + * @member {Array.} sources + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.sources = $util.emptyArray; + + /** + * ListSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} ListSourcesResponse instance + */ + ListSourcesResponse.create = function create(properties) { + return new ListSourcesResponse(properties); + }; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.Source.encode(message.sources[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 ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.securitycenter.v1p1beta1.Source.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Source.verify(message.sources[i]); + if (error) + return "sources." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} ListSourcesResponse + */ + ListSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListSourcesResponse(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListSourcesResponse.sources: object expected"); + message.sources[i] = $root.google.cloud.securitycenter.v1p1beta1.Source.fromObject(object.sources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListSourcesResponse} message ListSourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sources = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.securitycenter.v1p1beta1.Source.toObject(message.sources[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListSourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListSourcesResponse"; + }; + + return ListSourcesResponse; + })(); + + v1p1beta1.ListAssetsRequest = (function() { + + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {string|null} [filter] ListAssetsRequest filter + * @property {string|null} [orderBy] ListAssetsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListAssetsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListAssetsRequest fieldMask + * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {number|null} [pageSize] ListAssetsRequest pageSize + */ + + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; + + /** + * ListAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.filter = ""; + + /** + * ListAssetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.orderBy = ""; + + /** + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.readTime = null; + + /** + * ListAssetsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.compareDuration = null; + + /** + * ListAssetsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.fieldMask = null; + + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest(); + 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.orderBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 8: { + message.pageToken = reader.string(); + break; + } + case 9: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsRequest.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} ListAssetsRequest + */ + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + 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 ListAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsRequest} message ListAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + 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.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + 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 ListAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListAssetsRequest"; + }; + + return ListAssetsRequest; + })(); + + v1p1beta1.ListAssetsResponse = (function() { + + /** + * Properties of a ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListAssetsResponse + * @property {Array.|null} [listAssetsResults] ListAssetsResponse listAssetsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + * @property {number|null} [totalSize] ListAssetsResponse totalSize + */ + + /** + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsResponse=} [properties] Properties to set + */ + function ListAssetsResponse(properties) { + this.listAssetsResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssetsResponse listAssetsResults. + * @member {Array.} listAssetsResults + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.listAssetsResults = $util.emptyArray; + + /** + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.readTime = null; + + /** + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.nextPageToken = ""; + + /** + * ListAssetsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} ListAssetsResponse instance + */ + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); + }; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listAssetsResults != null && message.listAssetsResults.length) + for (var i = 0; i < message.listAssetsResults.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.encode(message.listAssetsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.listAssetsResults && message.listAssetsResults.length)) + message.listAssetsResults = []; + message.listAssetsResults.push($root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResponse message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listAssetsResults != null && message.hasOwnProperty("listAssetsResults")) { + if (!Array.isArray(message.listAssetsResults)) + return "listAssetsResults: array expected"; + for (var i = 0; i < message.listAssetsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.verify(message.listAssetsResults[i]); + if (error) + return "listAssetsResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} ListAssetsResponse + */ + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse(); + if (object.listAssetsResults) { + if (!Array.isArray(object.listAssetsResults)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.listAssetsResults: array expected"); + message.listAssetsResults = []; + for (var i = 0; i < object.listAssetsResults.length; ++i) { + if (typeof object.listAssetsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.listAssetsResults: object expected"); + message.listAssetsResults[i] = $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.fromObject(object.listAssetsResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse} message ListAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listAssetsResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.listAssetsResults && message.listAssetsResults.length) { + object.listAssetsResults = []; + for (var j = 0; j < message.listAssetsResults.length; ++j) + object.listAssetsResults[j] = $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.toObject(message.listAssetsResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListAssetsResponse"; + }; + + ListAssetsResponse.ListAssetsResult = (function() { + + /** + * Properties of a ListAssetsResult. + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @interface IListAssetsResult + * @property {google.cloud.securitycenter.v1p1beta1.IAsset|null} [asset] ListAssetsResult asset + * @property {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange|null} [stateChange] ListAssetsResult stateChange + */ + + /** + * Constructs a new ListAssetsResult. + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse + * @classdesc Represents a ListAssetsResult. + * @implements IListAssetsResult + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + */ + function ListAssetsResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssetsResult asset. + * @member {google.cloud.securitycenter.v1p1beta1.IAsset|null|undefined} asset + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.asset = null; + + /** + * ListAssetsResult stateChange. + * @member {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange} stateChange + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @instance + */ + ListAssetsResult.prototype.stateChange = 0; + + /** + * Creates a new ListAssetsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult instance + */ + ListAssetsResult.create = function create(properties) { + return new ListAssetsResult(properties); + }; + + /** + * Encodes the specified ListAssetsResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + $root.google.cloud.securitycenter.v1p1beta1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateChange != null && Object.hasOwnProperty.call(message, "stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); + return writer; + }; + + /** + * Encodes the specified ListAssetsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult} message ListAssetsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.asset = $root.google.cloud.securitycenter.v1p1beta1.Asset.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stateChange = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + switch (message.stateChange) { + default: + return "stateChange: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ListAssetsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} ListAssetsResult + */ + ListAssetsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult(); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.asset: object expected"); + message.asset = $root.google.cloud.securitycenter.v1p1beta1.Asset.fromObject(object.asset); + } + switch (object.stateChange) { + default: + if (typeof object.stateChange === "number") { + message.stateChange = object.stateChange; + break; + } + break; + case "UNUSED": + case 0: + message.stateChange = 0; + break; + case "ADDED": + case 1: + message.stateChange = 1; + break; + case "REMOVED": + case 2: + message.stateChange = 2; + break; + case "ACTIVE": + case 3: + message.stateChange = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListAssetsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} message ListAssetsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.asset = null; + object.stateChange = options.enums === String ? "UNUSED" : 0; + } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.securitycenter.v1p1beta1.Asset.toObject(message.asset, options); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] === undefined ? message.stateChange : $root.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange[message.stateChange] : message.stateChange; + return object; + }; + + /** + * Converts this ListAssetsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult"; + }; + + /** + * StateChange enum. + * @name google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange + * @enum {number} + * @property {number} UNUSED=0 UNUSED value + * @property {number} ADDED=1 ADDED value + * @property {number} REMOVED=2 REMOVED value + * @property {number} ACTIVE=3 ACTIVE value + */ + ListAssetsResult.StateChange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNUSED"] = 0; + values[valuesById[1] = "ADDED"] = 1; + values[valuesById[2] = "REMOVED"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + return values; + })(); + + return ListAssetsResult; + })(); + + return ListAssetsResponse; + })(); + + v1p1beta1.ListFindingsRequest = (function() { + + /** + * Properties of a ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [orderBy] ListFindingsRequest orderBy + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsRequest readTime + * @property {google.protobuf.IDuration|null} [compareDuration] ListFindingsRequest compareDuration + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListFindingsRequest fieldMask + * @property {string|null} [pageToken] ListFindingsRequest pageToken + * @property {number|null} [pageSize] ListFindingsRequest pageSize + */ + + /** + * Constructs a new ListFindingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.parent = ""; + + /** + * ListFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.filter = ""; + + /** + * ListFindingsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.orderBy = ""; + + /** + * ListFindingsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.readTime = null; + + /** + * ListFindingsRequest compareDuration. + * @member {google.protobuf.IDuration|null|undefined} compareDuration + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.compareDuration = null; + + /** + * ListFindingsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.fieldMask = null; + + /** + * ListFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageToken = ""; + + /** + * ListFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} ListFindingsRequest instance + */ + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); + }; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.compareDuration != null && Object.hasOwnProperty.call(message, "compareDuration")) + $root.google.protobuf.Duration.encode(message.compareDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.orderBy = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.compareDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 8: { + message.pageToken = reader.string(); + break; + } + case 9: { + 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.securitycenter.v1p1beta1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) { + var error = $root.google.protobuf.Duration.verify(message.compareDuration); + if (error) + return "compareDuration." + error; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + 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.securitycenter.v1p1beta1.ListFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsRequest} ListFindingsRequest + */ + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.compareDuration != null) { + if (typeof object.compareDuration !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.compareDuration: object expected"); + message.compareDuration = $root.google.protobuf.Duration.fromObject(object.compareDuration); + } + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + 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.securitycenter.v1p1beta1.ListFindingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.orderBy = ""; + object.readTime = null; + object.compareDuration = null; + object.fieldMask = null; + 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.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.compareDuration != null && message.hasOwnProperty("compareDuration")) + object.compareDuration = $root.google.protobuf.Duration.toObject(message.compareDuration, options); + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + 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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.ListFindingsRequest"; + }; + + return ListFindingsRequest; + })(); + + v1p1beta1.ListFindingsResponse = (function() { + + /** + * Properties of a ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IListFindingsResponse + * @property {Array.|null} [listFindingsResults] ListFindingsResponse listFindingsResults + * @property {google.protobuf.ITimestamp|null} [readTime] ListFindingsResponse readTime + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + * @property {number|null} [totalSize] ListFindingsResponse totalSize + */ + + /** + * Constructs a new ListFindingsResponse. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsResponse=} [properties] Properties to set + */ + function ListFindingsResponse(properties) { + this.listFindingsResults = []; + if (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 listFindingsResults. + * @member {Array.} listFindingsResults + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.listFindingsResults = $util.emptyArray; + + /** + * ListFindingsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.readTime = null; + + /** + * ListFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.nextPageToken = ""; + + /** + * ListFindingsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} ListFindingsResponse instance + */ + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); + }; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.listFindingsResults != null && message.listFindingsResults.length) + for (var i = 0; i < message.listFindingsResults.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.encode(message.listFindingsResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.ListFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.listFindingsResults && message.listFindingsResults.length)) + message.listFindingsResults = []; + message.listFindingsResults.push($root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalSize = reader.int32(); + 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.securitycenter.v1p1beta1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.listFindingsResults != null && message.hasOwnProperty("listFindingsResults")) { + if (!Array.isArray(message.listFindingsResults)) + return "listFindingsResults: array expected"; + for (var i = 0; i < message.listFindingsResults.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.verify(message.listFindingsResults[i]); + if (error) + return "listFindingsResults." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse} ListFindingsResponse + */ + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse(); + if (object.listFindingsResults) { + if (!Array.isArray(object.listFindingsResults)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.listFindingsResults: array expected"); + message.listFindingsResults = []; + for (var i = 0; i < object.listFindingsResults.length; ++i) { + if (typeof object.listFindingsResults[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.listFindingsResults: object expected"); + message.listFindingsResults[i] = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.fromObject(object.listFindingsResults[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @static + * @param {google.cloud.securitycenter.v1p1beta1.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.listFindingsResults = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.listFindingsResults && message.listFindingsResults.length) { + object.listFindingsResults = []; + for (var j = 0; j < message.listFindingsResults.length; ++j) + object.listFindingsResults[j] = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.toObject(message.listFindingsResults[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.ListFindingsResponse"; + }; + + ListFindingsResponse.ListFindingsResult = (function() { + + /** + * Properties of a ListFindingsResult. + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @interface IListFindingsResult + * @property {google.cloud.securitycenter.v1p1beta1.IFinding|null} [finding] ListFindingsResult finding + * @property {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange|null} [stateChange] ListFindingsResult stateChange + * @property {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource|null} [resource] ListFindingsResult resource + */ + + /** + * Constructs a new ListFindingsResult. + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse + * @classdesc Represents a ListFindingsResult. + * @implements IListFindingsResult + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set + */ + function ListFindingsResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingsResult finding. + * @member {google.cloud.securitycenter.v1p1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.finding = null; + + /** + * ListFindingsResult stateChange. + * @member {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange} stateChange + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.stateChange = 0; + + /** + * ListFindingsResult resource. + * @member {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource|null|undefined} resource + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @instance + */ + ListFindingsResult.prototype.resource = null; + + /** + * Creates a new ListFindingsResult instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} ListFindingsResult instance + */ + ListFindingsResult.create = function create(properties) { + return new ListFindingsResult(properties); + }; + + /** + * Encodes the specified ListFindingsResult message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1p1beta1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stateChange != null && Object.hasOwnProperty.call(message, "stateChange")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stateChange); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListFindingsResult message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult} message ListFindingsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stateChange = reader.int32(); + break; + } + case 3: { + message.resource = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsResult message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Finding.verify(message.finding); + if (error) + return "finding." + error; + } + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + switch (message.stateChange) { + default: + return "stateChange: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a ListFindingsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} ListFindingsResult + */ + ListFindingsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.fromObject(object.finding); + } + switch (object.stateChange) { + default: + if (typeof object.stateChange === "number") { + message.stateChange = object.stateChange; + break; + } + break; + case "UNUSED": + case 0: + message.stateChange = 0; + break; + case "CHANGED": + case 1: + message.stateChange = 1; + break; + case "UNCHANGED": + case 2: + message.stateChange = 2; + break; + case "ADDED": + case 3: + message.stateChange = 3; + break; + case "REMOVED": + case 4: + message.stateChange = 4; + break; + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.resource: object expected"); + message.resource = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a ListFindingsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} message ListFindingsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finding = null; + object.stateChange = options.enums === String ? "UNUSED" : 0; + object.resource = null; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.toObject(message.finding, options); + if (message.stateChange != null && message.hasOwnProperty("stateChange")) + object.stateChange = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] === undefined ? message.stateChange : $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange[message.stateChange] : message.stateChange; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.toObject(message.resource, options); + return object; + }; + + /** + * Converts this ListFindingsResult to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingsResult + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult"; + }; + + ListFindingsResult.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @interface IResource + * @property {string|null} [name] Resource name + * @property {string|null} [projectName] Resource projectName + * @property {string|null} [projectDisplayName] Resource projectDisplayName + * @property {string|null} [parentName] Resource parentName + * @property {string|null} [parentDisplayName] Resource parentDisplayName + * @property {Array.|null} [folders] Resource folders + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set + */ + function Resource(properties) { + this.folders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resource name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.name = ""; + + /** + * Resource projectName. + * @member {string} projectName + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.projectName = ""; + + /** + * Resource projectDisplayName. + * @member {string} projectDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.projectDisplayName = ""; + + /** + * Resource parentName. + * @member {string} parentName + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.parentName = ""; + + /** + * Resource parentDisplayName. + * @member {string} parentDisplayName + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.parentDisplayName = ""; + + /** + * Resource folders. + * @member {Array.} folders + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + */ + Resource.prototype.folders = $util.emptyArray; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.projectName != null && Object.hasOwnProperty.call(message, "projectName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectName); + if (message.projectDisplayName != null && Object.hasOwnProperty.call(message, "projectDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectDisplayName); + if (message.parentName != null && Object.hasOwnProperty.call(message, "parentName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentName); + if (message.parentDisplayName != null && Object.hasOwnProperty.call(message, "parentDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentDisplayName); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.securitycenter.v1p1beta1.Folder.encode(message.folders[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.projectName = reader.string(); + break; + } + case 3: { + message.projectDisplayName = reader.string(); + break; + } + case 4: { + message.parentName = reader.string(); + break; + } + case 5: { + message.parentDisplayName = reader.string(); + break; + } + case 10: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.securitycenter.v1p1beta1.Folder.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.projectName != null && message.hasOwnProperty("projectName")) + if (!$util.isString(message.projectName)) + return "projectName: string expected"; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + if (!$util.isString(message.projectDisplayName)) + return "projectDisplayName: string expected"; + if (message.parentName != null && message.hasOwnProperty("parentName")) + if (!$util.isString(message.parentName)) + return "parentName: string expected"; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + if (!$util.isString(message.parentDisplayName)) + return "parentDisplayName: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource(); + if (object.name != null) + message.name = String(object.name); + if (object.projectName != null) + message.projectName = String(object.projectName); + if (object.projectDisplayName != null) + message.projectDisplayName = String(object.projectDisplayName); + if (object.parentName != null) + message.parentName = String(object.parentName); + if (object.parentDisplayName != null) + message.parentDisplayName = String(object.parentDisplayName); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource.folders: object expected"); + message.folders[i] = $root.google.cloud.securitycenter.v1p1beta1.Folder.fromObject(object.folders[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.folders = []; + if (options.defaults) { + object.name = ""; + object.projectName = ""; + object.projectDisplayName = ""; + object.parentName = ""; + object.parentDisplayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.projectName != null && message.hasOwnProperty("projectName")) + object.projectName = message.projectName; + if (message.projectDisplayName != null && message.hasOwnProperty("projectDisplayName")) + object.projectDisplayName = message.projectDisplayName; + if (message.parentName != null && message.hasOwnProperty("parentName")) + object.parentName = message.parentName; + if (message.parentDisplayName != null && message.hasOwnProperty("parentDisplayName")) + object.parentDisplayName = message.parentDisplayName; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.securitycenter.v1p1beta1.Folder.toObject(message.folders[j], options); + } + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource"; + }; + + return Resource; + })(); + + /** + * StateChange enum. + * @name google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange + * @enum {number} + * @property {number} UNUSED=0 UNUSED value + * @property {number} CHANGED=1 CHANGED value + * @property {number} UNCHANGED=2 UNCHANGED value + * @property {number} ADDED=3 ADDED value + * @property {number} REMOVED=4 REMOVED value + */ + ListFindingsResult.StateChange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNUSED"] = 0; + values[valuesById[1] = "CHANGED"] = 1; + values[valuesById[2] = "UNCHANGED"] = 2; + values[valuesById[3] = "ADDED"] = 3; + values[valuesById[4] = "REMOVED"] = 4; + return values; + })(); + + return ListFindingsResult; + })(); + + return ListFindingsResponse; + })(); + + v1p1beta1.SetFindingStateRequest = (function() { + + /** + * Properties of a SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface ISetFindingStateRequest + * @property {string|null} [name] SetFindingStateRequest name + * @property {google.cloud.securitycenter.v1p1beta1.Finding.State|null} [state] SetFindingStateRequest state + * @property {google.protobuf.ITimestamp|null} [startTime] SetFindingStateRequest startTime + */ + + /** + * Constructs a new SetFindingStateRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a SetFindingStateRequest. + * @implements ISetFindingStateRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest=} [properties] Properties to set + */ + function SetFindingStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetFindingStateRequest name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.name = ""; + + /** + * SetFindingStateRequest state. + * @member {google.cloud.securitycenter.v1p1beta1.Finding.State} state + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.state = 0; + + /** + * SetFindingStateRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @instance + */ + SetFindingStateRequest.prototype.startTime = null; + + /** + * Creates a new SetFindingStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} SetFindingStateRequest instance + */ + SetFindingStateRequest.create = function create(properties) { + return new SetFindingStateRequest(properties); + }; + + /** + * Encodes the specified SetFindingStateRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetFindingStateRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest} message SetFindingStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetFindingStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetFindingStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} SetFindingStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetFindingStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetFindingStateRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetFindingStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a SetFindingStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} SetFindingStateRequest + */ + SetFindingStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a SetFindingStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest} message SetFindingStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetFindingStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.securitycenter.v1p1beta1.Finding.State[message.state] === undefined ? message.state : $root.google.cloud.securitycenter.v1p1beta1.Finding.State[message.state] : message.state; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this SetFindingStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @instance + * @returns {Object.} JSON object + */ + SetFindingStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetFindingStateRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetFindingStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest"; + }; + + return SetFindingStateRequest; + })(); + + v1p1beta1.RunAssetDiscoveryRequest = (function() { + + /** + * Properties of a RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IRunAssetDiscoveryRequest + * @property {string|null} [parent] RunAssetDiscoveryRequest parent + */ + + /** + * Constructs a new RunAssetDiscoveryRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a RunAssetDiscoveryRequest. + * @implements IRunAssetDiscoveryRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + */ + function RunAssetDiscoveryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunAssetDiscoveryRequest parent. + * @member {string} parent + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @instance + */ + RunAssetDiscoveryRequest.prototype.parent = ""; + + /** + * Creates a new RunAssetDiscoveryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest instance + */ + RunAssetDiscoveryRequest.create = function create(properties) { + return new RunAssetDiscoveryRequest(properties); + }; + + /** + * Encodes the specified RunAssetDiscoveryRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.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 RunAssetDiscoveryRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest} message RunAssetDiscoveryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAssetDiscoveryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAssetDiscoveryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest(); + 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 RunAssetDiscoveryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAssetDiscoveryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAssetDiscoveryRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAssetDiscoveryRequest.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 RunAssetDiscoveryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} RunAssetDiscoveryRequest + */ + RunAssetDiscoveryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a RunAssetDiscoveryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest} message RunAssetDiscoveryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAssetDiscoveryRequest.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 RunAssetDiscoveryRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @instance + * @returns {Object.} JSON object + */ + RunAssetDiscoveryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunAssetDiscoveryRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunAssetDiscoveryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest"; + }; + + return RunAssetDiscoveryRequest; + })(); + + v1p1beta1.UpdateFindingRequest = (function() { + + /** + * Properties of an UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IUpdateFindingRequest + * @property {google.cloud.securitycenter.v1p1beta1.IFinding|null} [finding] UpdateFindingRequest finding + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFindingRequest updateMask + */ + + /** + * Constructs a new UpdateFindingRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateFindingRequest. + * @implements IUpdateFindingRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest=} [properties] Properties to set + */ + function UpdateFindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateFindingRequest finding. + * @member {google.cloud.securitycenter.v1p1beta1.IFinding|null|undefined} finding + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.finding = null; + + /** + * UpdateFindingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @instance + */ + UpdateFindingRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} UpdateFindingRequest instance + */ + UpdateFindingRequest.create = function create(properties) { + return new UpdateFindingRequest(properties); + }; + + /** + * Encodes the specified UpdateFindingRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finding != null && Object.hasOwnProperty.call(message, "finding")) + $root.google.cloud.securitycenter.v1p1beta1.Finding.encode(message.finding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateFindingRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest} message UpdateFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} UpdateFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFindingRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finding != null && message.hasOwnProperty("finding")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Finding.verify(message.finding); + if (error) + return "finding." + 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 UpdateFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} UpdateFindingRequest + */ + UpdateFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest(); + if (object.finding != null) { + if (typeof object.finding !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.finding: object expected"); + message.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.fromObject(object.finding); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest} message UpdateFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finding = null; + object.updateMask = null; + } + if (message.finding != null && message.hasOwnProperty("finding")) + object.finding = $root.google.cloud.securitycenter.v1p1beta1.Finding.toObject(message.finding, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFindingRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest"; + }; + + return UpdateFindingRequest; + })(); + + v1p1beta1.UpdateNotificationConfigRequest = (function() { + + /** + * Properties of an UpdateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IUpdateNotificationConfigRequest + * @property {google.cloud.securitycenter.v1p1beta1.INotificationConfig|null} [notificationConfig] UpdateNotificationConfigRequest notificationConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateNotificationConfigRequest updateMask + */ + + /** + * Constructs a new UpdateNotificationConfigRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateNotificationConfigRequest. + * @implements IUpdateNotificationConfigRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest=} [properties] Properties to set + */ + function UpdateNotificationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateNotificationConfigRequest notificationConfig. + * @member {google.cloud.securitycenter.v1p1beta1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @instance + */ + UpdateNotificationConfigRequest.prototype.notificationConfig = null; + + /** + * UpdateNotificationConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @instance + */ + UpdateNotificationConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateNotificationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest instance + */ + UpdateNotificationConfigRequest.create = function create(properties) { + return new UpdateNotificationConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateNotificationConfigRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest} message UpdateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateNotificationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateNotificationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest} message UpdateNotificationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateNotificationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateNotificationConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateNotificationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateNotificationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateNotificationConfigRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateNotificationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + 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 UpdateNotificationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} UpdateNotificationConfigRequest + */ + UpdateNotificationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest(); + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.fromObject(object.notificationConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateNotificationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest} message UpdateNotificationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateNotificationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.notificationConfig = null; + object.updateMask = null; + } + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.securitycenter.v1p1beta1.NotificationConfig.toObject(message.notificationConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateNotificationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateNotificationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateNotificationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateNotificationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest"; + }; + + return UpdateNotificationConfigRequest; + })(); + + v1p1beta1.UpdateOrganizationSettingsRequest = (function() { + + /** + * Properties of an UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IUpdateOrganizationSettingsRequest + * @property {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings|null} [organizationSettings] UpdateOrganizationSettingsRequest organizationSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationSettingsRequest updateMask + */ + + /** + * Constructs a new UpdateOrganizationSettingsRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateOrganizationSettingsRequest. + * @implements IUpdateOrganizationSettingsRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + */ + function UpdateOrganizationSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateOrganizationSettingsRequest organizationSettings. + * @member {google.cloud.securitycenter.v1p1beta1.IOrganizationSettings|null|undefined} organizationSettings + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.organizationSettings = null; + + /** + * UpdateOrganizationSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @instance + */ + UpdateOrganizationSettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateOrganizationSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest instance + */ + UpdateOrganizationSettingsRequest.create = function create(properties) { + return new UpdateOrganizationSettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organizationSettings != null && Object.hasOwnProperty.call(message, "organizationSettings")) + $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.encode(message.organizationSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateOrganizationSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.organizationSettings = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateOrganizationSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateOrganizationSettingsRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateOrganizationSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.verify(message.organizationSettings); + if (error) + return "organizationSettings." + 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 UpdateOrganizationSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} UpdateOrganizationSettingsRequest + */ + UpdateOrganizationSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest(); + if (object.organizationSettings != null) { + if (typeof object.organizationSettings !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.organizationSettings: object expected"); + message.organizationSettings = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.fromObject(object.organizationSettings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateOrganizationSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest} message UpdateOrganizationSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateOrganizationSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.organizationSettings = null; + object.updateMask = null; + } + if (message.organizationSettings != null && message.hasOwnProperty("organizationSettings")) + object.organizationSettings = $root.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.toObject(message.organizationSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateOrganizationSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOrganizationSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateOrganizationSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateOrganizationSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest"; + }; + + return UpdateOrganizationSettingsRequest; + })(); + + v1p1beta1.UpdateSourceRequest = (function() { + + /** + * Properties of an UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IUpdateSourceRequest + * @property {google.cloud.securitycenter.v1p1beta1.ISource|null} [source] UpdateSourceRequest source + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + */ + + /** + * Constructs a new UpdateSourceRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateSourceRequest. + * @implements IUpdateSourceRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest=} [properties] Properties to set + */ + function UpdateSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSourceRequest source. + * @member {google.cloud.securitycenter.v1p1beta1.ISource|null|undefined} source + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.source = null; + + /** + * UpdateSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} UpdateSourceRequest instance + */ + UpdateSourceRequest.create = function create(properties) { + return new UpdateSourceRequest(properties); + }; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.securitycenter.v1p1beta1.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.securitycenter.v1p1beta1.Source.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSourceRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.Source.verify(message.source); + if (error) + return "source." + 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 UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} UpdateSourceRequest + */ + UpdateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.source: object expected"); + message.source = $root.google.cloud.securitycenter.v1p1beta1.Source.fromObject(object.source); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest} message UpdateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.updateMask = null; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.securitycenter.v1p1beta1.Source.toObject(message.source, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest"; + }; + + return UpdateSourceRequest; + })(); + + v1p1beta1.UpdateSecurityMarksRequest = (function() { + + /** + * Properties of an UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface IUpdateSecurityMarksRequest + * @property {google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null} [securityMarks] UpdateSecurityMarksRequest securityMarks + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityMarksRequest updateMask + * @property {google.protobuf.ITimestamp|null} [startTime] UpdateSecurityMarksRequest startTime + */ + + /** + * Constructs a new UpdateSecurityMarksRequest. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents an UpdateSecurityMarksRequest. + * @implements IUpdateSecurityMarksRequest + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set + */ + function UpdateSecurityMarksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSecurityMarksRequest securityMarks. + * @member {google.cloud.securitycenter.v1p1beta1.ISecurityMarks|null|undefined} securityMarks + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.securityMarks = null; + + /** + * UpdateSecurityMarksRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.updateMask = null; + + /** + * UpdateSecurityMarksRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @instance + */ + UpdateSecurityMarksRequest.prototype.startTime = null; + + /** + * Creates a new UpdateSecurityMarksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest instance + */ + UpdateSecurityMarksRequest.create = function create(properties) { + return new UpdateSecurityMarksRequest(properties); + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityMarks != null && Object.hasOwnProperty.call(message, "securityMarks")) + $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.encode(message.securityMarks, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSecurityMarksRequest message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest} message UpdateSecurityMarksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecurityMarksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSecurityMarksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecurityMarksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSecurityMarksRequest message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSecurityMarksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) { + var error = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.verify(message.securityMarks); + if (error) + return "securityMarks." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates an UpdateSecurityMarksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} UpdateSecurityMarksRequest + */ + UpdateSecurityMarksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest(); + if (object.securityMarks != null) { + if (typeof object.securityMarks !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.securityMarks: object expected"); + message.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.fromObject(object.securityMarks); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSecurityMarksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest} message UpdateSecurityMarksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSecurityMarksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityMarks = null; + object.updateMask = null; + object.startTime = null; + } + if (message.securityMarks != null && message.hasOwnProperty("securityMarks")) + object.securityMarks = $root.google.cloud.securitycenter.v1p1beta1.SecurityMarks.toObject(message.securityMarks, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this UpdateSecurityMarksRequest to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecurityMarksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSecurityMarksRequest + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSecurityMarksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest"; + }; + + return UpdateSecurityMarksRequest; + })(); + + v1p1beta1.Source = (function() { + + /** + * Properties of a Source. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @interface ISource + * @property {string|null} [name] Source name + * @property {string|null} [displayName] Source displayName + * @property {string|null} [description] Source description + * @property {string|null} [canonicalName] Source canonicalName + */ + + /** + * Constructs a new Source. + * @memberof google.cloud.securitycenter.v1p1beta1 + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.cloud.securitycenter.v1p1beta1.ISource=} [properties] Properties to set + */ + function Source(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Source name. + * @member {string} name + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @instance + */ + Source.prototype.name = ""; + + /** + * Source displayName. + * @member {string} displayName + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @instance + */ + Source.prototype.displayName = ""; + + /** + * Source description. + * @member {string} description + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @instance + */ + Source.prototype.description = ""; + + /** + * Source canonicalName. + * @member {string} canonicalName + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @instance + */ + Source.prototype.canonicalName = ""; + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ISource=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1p1beta1.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Source.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.canonicalName != null && Object.hasOwnProperty.call(message, "canonicalName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.canonicalName); + return writer; + }; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1p1beta1.Source.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1p1beta1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Source message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1p1beta1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1p1beta1.Source(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 14: { + message.canonicalName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1p1beta1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Source message. + * @function verify + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Source.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + if (!$util.isString(message.canonicalName)) + return "canonicalName: string expected"; + return null; + }; + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1p1beta1.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1p1beta1.Source) + return object; + var message = new $root.google.cloud.securitycenter.v1p1beta1.Source(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.canonicalName != null) + message.canonicalName = String(object.canonicalName); + return message; + }; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @static + * @param {google.cloud.securitycenter.v1p1beta1.Source} message Source + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Source.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.canonicalName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.canonicalName != null && message.hasOwnProperty("canonicalName")) + object.canonicalName = message.canonicalName; + return object; + }; + + /** + * Converts this Source to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @instance + * @returns {Object.} JSON object + */ + Source.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Source + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1p1beta1.Source + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Source.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1p1beta1.Source"; + }; + + return Source; + })(); + + return v1p1beta1; + })(); + + return securitycenter; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + 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; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + 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 {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + */ + + /** + * 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.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.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 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + return null; + }; + + /** + * Creates 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.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + return message; + }; + + /** + * 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 + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + protobuf.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.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.IAMPolicy = (function() { + + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @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 IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @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 {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * SetIamPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.updateMask = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, 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 SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + object.updateMask = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; + }; + + return SetIamPolicyRequest; + })(); + + v1.GetIamPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ + + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; + + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; + }; + + return GetIamPolicyRequest; + })(); + + v1.TestIamPermissionsRequest = (function() { + + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ + + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; + }; + + return TestIamPermissionsRequest; + })(); + + v1.TestIamPermissionsResponse = (function() { + + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ + + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; + }; + + return TestIamPermissionsResponse; + })(); + + v1.GetPolicyOptions = (function() { + + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ + + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requestedPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; + + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPolicyOptions + * @function getTypeUrl + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; + }; + + return GetPolicyOptions; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json new file mode 100644 index 00000000000..57619a9a87e --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -0,0 +1,7963 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "securitycenter": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.SecurityCenter.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.cloud.securitycenter.v1", + "php_namespace": "Google\\Cloud\\SecurityCenter\\V1", + "ruby_package": "Google::Cloud::SecurityCenter::V1", + "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic", + "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}" + }, + "nested": { + "Access": { + "fields": { + "principalEmail": { + "type": "string", + "id": 1 + }, + "callerIp": { + "type": "string", + "id": 2 + }, + "callerIpGeo": { + "type": "Geolocation", + "id": 3 + }, + "userAgentFamily": { + "type": "string", + "id": 4 + }, + "serviceName": { + "type": "string", + "id": 5 + }, + "methodName": { + "type": "string", + "id": 6 + }, + "principalSubject": { + "type": "string", + "id": 7 + }, + "serviceAccountKeyName": { + "type": "string", + "id": 8 + }, + "serviceAccountDelegationInfo": { + "rule": "repeated", + "type": "ServiceAccountDelegationInfo", + "id": 9 + } + } + }, + "ServiceAccountDelegationInfo": { + "fields": { + "principalEmail": { + "type": "string", + "id": 1 + }, + "principalSubject": { + "type": "string", + "id": 2 + } + } + }, + "Geolocation": { + "fields": { + "regionCode": { + "type": "string", + "id": 1 + } + } + }, + "Asset": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Asset", + "(google.api.resource).pattern": "projects/{project}/assets/{asset}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "securityCenterProperties": { + "type": "SecurityCenterProperties", + "id": 2 + }, + "resourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "iamPolicy": { + "type": "IamPolicy", + "id": 11 + }, + "canonicalName": { + "type": "string", + "id": 13 + } + }, + "nested": { + "SecurityCenterProperties": { + "fields": { + "resourceName": { + "type": "string", + "id": 1 + }, + "resourceType": { + "type": "string", + "id": 2 + }, + "resourceParent": { + "type": "string", + "id": 3 + }, + "resourceProject": { + "type": "string", + "id": 4 + }, + "resourceOwners": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "resourceDisplayName": { + "type": "string", + "id": 6 + }, + "resourceParentDisplayName": { + "type": "string", + "id": 7 + }, + "resourceProjectDisplayName": { + "type": "string", + "id": 8 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 10 + } + } + }, + "IamPolicy": { + "fields": { + "policyBlob": { + "type": "string", + "id": 1 + } + } + } + } + }, + "Folder": { + "fields": { + "resourceFolder": { + "type": "string", + "id": 1 + }, + "resourceFolderDisplayName": { + "type": "string", + "id": 2 + } + } + }, + "SecurityMarks": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}/securityMarks" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marks": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "canonicalName": { + "type": "string", + "id": 3 + } + } + }, + "BigQueryExport": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/BigQueryExport", + "(google.api.resource).pattern": "projects/{project}/bigQueryExports/{export}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "filter": { + "type": "string", + "id": 3 + }, + "dataset": { + "type": "string", + "id": 4 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mostRecentEditor": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "principal": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Compliance": { + "fields": { + "standard": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + }, + "ids": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "Connection": { + "fields": { + "destinationIp": { + "type": "string", + "id": 1 + }, + "destinationPort": { + "type": "int32", + "id": 2 + }, + "sourceIp": { + "type": "string", + "id": 3 + }, + "sourcePort": { + "type": "int32", + "id": 4 + }, + "protocol": { + "type": "Protocol", + "id": 5 + } + }, + "nested": { + "Protocol": { + "values": { + "PROTOCOL_UNSPECIFIED": 0, + "ICMP": 1, + "TCP": 6, + "UDP": 17, + "GRE": 47, + "ESP": 50 + } + } + } + }, + "ContactDetails": { + "fields": { + "contacts": { + "rule": "repeated", + "type": "Contact", + "id": 1 + } + } + }, + "Contact": { + "fields": { + "email": { + "type": "string", + "id": 1 + } + } + }, + "Container": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + }, + "imageId": { + "type": "string", + "id": 3 + }, + "labels": { + "rule": "repeated", + "type": "Label", + "id": 4 + } + } + }, + "Label": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + }, + "Database": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "userName": { + "type": "string", + "id": 3 + }, + "query": { + "type": "string", + "id": 4 + }, + "grantees": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, + "Exfiltration": { + "fields": { + "sources": { + "rule": "repeated", + "type": "ExfilResource", + "id": 1 + }, + "targets": { + "rule": "repeated", + "type": "ExfilResource", + "id": 2 + } + } + }, + "ExfilResource": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "components": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "ExternalSystem": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/ExternalSystem", + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assignees": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "externalUid": { + "type": "string", + "id": 3 + }, + "status": { + "type": "string", + "id": 4 + }, + "externalSystemUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, + "File": { + "fields": { + "path": { + "type": "string", + "id": 1 + }, + "size": { + "type": "int64", + "id": 2 + }, + "sha256": { + "type": "string", + "id": 3 + }, + "hashedSize": { + "type": "int64", + "id": 4 + }, + "partiallyHashed": { + "type": "bool", + "id": 5 + }, + "contents": { + "type": "string", + "id": 6 + } + } + }, + "Finding": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Finding", + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "resourceName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + }, + "category": { + "type": "string", + "id": 5 + }, + "externalUri": { + "type": "string", + "id": 6 + }, + "sourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "severity": { + "type": "Severity", + "id": 12 + }, + "canonicalName": { + "type": "string", + "id": 14 + }, + "mute": { + "type": "Mute", + "id": 15 + }, + "findingClass": { + "type": "FindingClass", + "id": 17 + }, + "indicator": { + "type": "Indicator", + "id": 18 + }, + "vulnerability": { + "type": "Vulnerability", + "id": 20 + }, + "muteUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalSystems": { + "keyType": "string", + "type": "ExternalSystem", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mitreAttack": { + "type": "MitreAttack", + "id": 25 + }, + "access": { + "type": "Access", + "id": 26 + }, + "connections": { + "rule": "repeated", + "type": "Connection", + "id": 31 + }, + "muteInitiator": { + "type": "string", + "id": 28 + }, + "processes": { + "rule": "repeated", + "type": "Process", + "id": 30 + }, + "contacts": { + "keyType": "string", + "type": "ContactDetails", + "id": 33, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "compliances": { + "rule": "repeated", + "type": "Compliance", + "id": 34 + }, + "parentDisplayName": { + "type": "string", + "id": 36, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 37 + }, + "exfiltration": { + "type": "Exfiltration", + "id": 38 + }, + "iamBindings": { + "rule": "repeated", + "type": "IamBinding", + "id": 39 + }, + "nextSteps": { + "type": "string", + "id": 40 + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 42 + }, + "kubernetes": { + "type": "Kubernetes", + "id": 43 + }, + "database": { + "type": "Database", + "id": 44 + }, + "files": { + "rule": "repeated", + "type": "File", + "id": 46 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2 + } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "CRITICAL": 1, + "HIGH": 2, + "MEDIUM": 3, + "LOW": 4 + } + }, + "Mute": { + "values": { + "MUTE_UNSPECIFIED": 0, + "MUTED": 1, + "UNMUTED": 2, + "UNDEFINED": 4 + } + }, + "FindingClass": { + "values": { + "FINDING_CLASS_UNSPECIFIED": 0, + "THREAT": 1, + "VULNERABILITY": 2, + "MISCONFIGURATION": 3, + "OBSERVATION": 4, + "SCC_ERROR": 5 + } + } + } + }, + "IamBinding": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "Indicator": { + "fields": { + "ipAddresses": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "domains": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "signatures": { + "rule": "repeated", + "type": "ProcessSignature", + "id": 3 + }, + "uris": { + "rule": "repeated", + "type": "string", + "id": 4 + } + }, + "nested": { + "ProcessSignature": { + "oneofs": { + "signature": { + "oneof": [ + "memoryHashSignature", + "yaraRuleSignature" + ] + } + }, + "fields": { + "memoryHashSignature": { + "type": "MemoryHashSignature", + "id": 6 + }, + "yaraRuleSignature": { + "type": "YaraRuleSignature", + "id": 7 + } + }, + "nested": { + "MemoryHashSignature": { + "fields": { + "binaryFamily": { + "type": "string", + "id": 1 + }, + "detections": { + "rule": "repeated", + "type": "Detection", + "id": 4 + } + }, + "nested": { + "Detection": { + "fields": { + "binary": { + "type": "string", + "id": 2 + }, + "percentPagesMatched": { + "type": "double", + "id": 3 + } + } + } + } + }, + "YaraRuleSignature": { + "fields": { + "yaraRule": { + "type": "string", + "id": 5 + } + } + } + } + } + } + }, + "Kubernetes": { + "fields": { + "pods": { + "rule": "repeated", + "type": "Pod", + "id": 1 + }, + "nodes": { + "rule": "repeated", + "type": "Node", + "id": 2 + }, + "nodePools": { + "rule": "repeated", + "type": "NodePool", + "id": 3 + }, + "roles": { + "rule": "repeated", + "type": "Role", + "id": 4 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 5 + }, + "accessReviews": { + "rule": "repeated", + "type": "AccessReview", + "id": 6 + } + }, + "nested": { + "Pod": { + "fields": { + "ns": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + }, + "labels": { + "rule": "repeated", + "type": "Label", + "id": 3 + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 4 + } + } + }, + "Node": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "NodePool": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "nodes": { + "rule": "repeated", + "type": "Node", + "id": 2 + } + } + }, + "Role": { + "fields": { + "kind": { + "type": "Kind", + "id": 1 + }, + "ns": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Kind": { + "values": { + "KIND_UNSPECIFIED": 0, + "ROLE": 1, + "CLUSTER_ROLE": 2 + } + } + } + }, + "Binding": { + "fields": { + "ns": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + }, + "role": { + "type": "Role", + "id": 3 + }, + "subjects": { + "rule": "repeated", + "type": "Subject", + "id": 4 + } + } + }, + "Subject": { + "fields": { + "kind": { + "type": "AuthType", + "id": 1 + }, + "ns": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + } + }, + "nested": { + "AuthType": { + "values": { + "AUTH_TYPE_UNSPECIFIED": 0, + "USER": 1, + "SERVICEACCOUNT": 2, + "GROUP": 3 + } + } + } + }, + "AccessReview": { + "fields": { + "group": { + "type": "string", + "id": 1 + }, + "ns": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + }, + "resource": { + "type": "string", + "id": 4 + }, + "subresource": { + "type": "string", + "id": 5 + }, + "verb": { + "type": "string", + "id": 6 + }, + "version": { + "type": "string", + "id": 7 + } + } + } + } + }, + "MitreAttack": { + "fields": { + "primaryTactic": { + "type": "Tactic", + "id": 1 + }, + "primaryTechniques": { + "rule": "repeated", + "type": "Technique", + "id": 2 + }, + "additionalTactics": { + "rule": "repeated", + "type": "Tactic", + "id": 3 + }, + "additionalTechniques": { + "rule": "repeated", + "type": "Technique", + "id": 4 + }, + "version": { + "type": "string", + "id": 5 + } + }, + "nested": { + "Tactic": { + "values": { + "TACTIC_UNSPECIFIED": 0, + "RECONNAISSANCE": 1, + "RESOURCE_DEVELOPMENT": 2, + "INITIAL_ACCESS": 5, + "EXECUTION": 3, + "PERSISTENCE": 6, + "PRIVILEGE_ESCALATION": 8, + "DEFENSE_EVASION": 7, + "CREDENTIAL_ACCESS": 9, + "DISCOVERY": 10, + "LATERAL_MOVEMENT": 11, + "COLLECTION": 12, + "COMMAND_AND_CONTROL": 4, + "EXFILTRATION": 13, + "IMPACT": 14 + } + }, + "Technique": { + "values": { + "TECHNIQUE_UNSPECIFIED": 0, + "ACTIVE_SCANNING": 1, + "SCANNING_IP_BLOCKS": 2, + "INGRESS_TOOL_TRANSFER": 3, + "NATIVE_API": 4, + "SHARED_MODULES": 5, + "COMMAND_AND_SCRIPTING_INTERPRETER": 6, + "UNIX_SHELL": 7, + "RESOURCE_HIJACKING": 8, + "PROXY": 9, + "EXTERNAL_PROXY": 10, + "MULTI_HOP_PROXY": 11, + "DYNAMIC_RESOLUTION": 12, + "UNSECURED_CREDENTIALS": 13, + "VALID_ACCOUNTS": 14, + "LOCAL_ACCOUNTS": 15, + "CLOUD_ACCOUNTS": 16, + "NETWORK_DENIAL_OF_SERVICE": 17, + "PERMISSION_GROUPS_DISCOVERY": 18, + "CLOUD_GROUPS": 19, + "EXFILTRATION_OVER_WEB_SERVICE": 20, + "EXFILTRATION_TO_CLOUD_STORAGE": 21, + "ACCOUNT_MANIPULATION": 22, + "SSH_AUTHORIZED_KEYS": 23, + "CREATE_OR_MODIFY_SYSTEM_PROCESS": 24, + "STEAL_WEB_SESSION_COOKIE": 25, + "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE": 26, + "EXPLOIT_PUBLIC_FACING_APPLICATION": 27, + "MODIFY_AUTHENTICATION_PROCESS": 28, + "DATA_DESTRUCTION": 29, + "DOMAIN_POLICY_MODIFICATION": 30, + "IMPAIR_DEFENSES": 31, + "NETWORK_SERVICE_DISCOVERY": 32, + "ACCESS_TOKEN_MANIPULATION": 33, + "ABUSE_ELEVATION_CONTROL_MECHANISM": 34, + "DEFAULT_ACCOUNTS": 35 + } + } + } + }, + "Process": { + "fields": { + "name": { + "type": "string", + "id": 12 + }, + "binary": { + "type": "File", + "id": 3 + }, + "libraries": { + "rule": "repeated", + "type": "File", + "id": 4 + }, + "script": { + "type": "File", + "id": 5 + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "argumentsTruncated": { + "type": "bool", + "id": 7 + }, + "envVariables": { + "rule": "repeated", + "type": "EnvironmentVariable", + "id": 8 + }, + "envVariablesTruncated": { + "type": "bool", + "id": 9 + }, + "pid": { + "type": "int64", + "id": 10 + }, + "parentPid": { + "type": "int64", + "id": 11 + } + } + }, + "EnvironmentVariable": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "val": { + "type": "string", + "id": 2 + } + } + }, + "Vulnerability": { + "fields": { + "cve": { + "type": "Cve", + "id": 1 + } + } + }, + "Cve": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "references": { + "rule": "repeated", + "type": "Reference", + "id": 2 + }, + "cvssv3": { + "type": "Cvssv3", + "id": 3 + }, + "upstreamFixAvailable": { + "type": "bool", + "id": 4 + } + } + }, + "Reference": { + "fields": { + "source": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + } + } + }, + "Cvssv3": { + "fields": { + "baseScore": { + "type": "double", + "id": 1 + }, + "attackVector": { + "type": "AttackVector", + "id": 5 + }, + "attackComplexity": { + "type": "AttackComplexity", + "id": 6 + }, + "privilegesRequired": { + "type": "PrivilegesRequired", + "id": 7 + }, + "userInteraction": { + "type": "UserInteraction", + "id": 8 + }, + "scope": { + "type": "Scope", + "id": 9 + }, + "confidentialityImpact": { + "type": "Impact", + "id": 10 + }, + "integrityImpact": { + "type": "Impact", + "id": 11 + }, + "availabilityImpact": { + "type": "Impact", + "id": 12 + } + }, + "nested": { + "AttackVector": { + "values": { + "ATTACK_VECTOR_UNSPECIFIED": 0, + "ATTACK_VECTOR_NETWORK": 1, + "ATTACK_VECTOR_ADJACENT": 2, + "ATTACK_VECTOR_LOCAL": 3, + "ATTACK_VECTOR_PHYSICAL": 4 + } + }, + "AttackComplexity": { + "values": { + "ATTACK_COMPLEXITY_UNSPECIFIED": 0, + "ATTACK_COMPLEXITY_LOW": 1, + "ATTACK_COMPLEXITY_HIGH": 2 + } + }, + "PrivilegesRequired": { + "values": { + "PRIVILEGES_REQUIRED_UNSPECIFIED": 0, + "PRIVILEGES_REQUIRED_NONE": 1, + "PRIVILEGES_REQUIRED_LOW": 2, + "PRIVILEGES_REQUIRED_HIGH": 3 + } + }, + "UserInteraction": { + "values": { + "USER_INTERACTION_UNSPECIFIED": 0, + "USER_INTERACTION_NONE": 1, + "USER_INTERACTION_REQUIRED": 2 + } + }, + "Scope": { + "values": { + "SCOPE_UNSPECIFIED": 0, + "SCOPE_UNCHANGED": 1, + "SCOPE_CHANGED": 2 + } + }, + "Impact": { + "values": { + "IMPACT_UNSPECIFIED": 0, + "IMPACT_HIGH": 1, + "IMPACT_LOW": 2, + "IMPACT_NONE": 3 + } + } + } + }, + "MuteConfig": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/MuteConfig", + "(google.api.resource).pattern": "projects/{project}/muteConfigs/{mute_config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "description": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mostRecentEditor": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "NotificationConfig": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/NotificationConfig", + "(google.api.resource).pattern": "projects/{project}/notificationConfigs/{notification_config}" + }, + "oneofs": { + "notifyConfig": { + "oneof": [ + "streamingConfig" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "pubsubTopic": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "serviceAccount": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "streamingConfig": { + "type": "StreamingConfig", + "id": 5 + } + }, + "nested": { + "StreamingConfig": { + "fields": { + "filter": { + "type": "string", + "id": 1 + } + } + } + } + }, + "NotificationMessage": { + "oneofs": { + "event": { + "oneof": [ + "finding" + ] + } + }, + "fields": { + "notificationConfigName": { + "type": "string", + "id": 1 + }, + "finding": { + "type": "Finding", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + } + } + }, + "Resource": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 8 + }, + "type": { + "type": "string", + "id": 6 + }, + "project": { + "type": "string", + "id": 2 + }, + "projectDisplayName": { + "type": "string", + "id": 3 + }, + "parent": { + "type": "string", + "id": 4 + }, + "parentDisplayName": { + "type": "string", + "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "OrganizationSettings": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/OrganizationSettings", + "(google.api.resource).pattern": "organizations/{organization}/organizationSettings" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "enableAssetDiscovery": { + "type": "bool", + "id": 2 + }, + "assetDiscoveryConfig": { + "type": "AssetDiscoveryConfig", + "id": 3 + } + }, + "nested": { + "AssetDiscoveryConfig": { + "fields": { + "projectIds": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "inclusionMode": { + "type": "InclusionMode", + "id": 2 + }, + "folderIds": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "InclusionMode": { + "values": { + "INCLUSION_MODE_UNSPECIFIED": 0, + "INCLUDE_ONLY": 1, + "EXCLUDE": 2 + } + } + } + } + } + }, + "RunAssetDiscoveryResponse": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "COMPLETED": 1, + "SUPERSEDED": 2, + "TERMINATED": 3 + } + } + } + }, + "SecurityCenter": { + "options": { + "(google.api.default_host)": "securitycenter.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "BulkMuteFindings": { + "requestType": "BulkMuteFindingsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/findings:bulkMute", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/findings:bulkMute", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "google.cloud.securitycenter.v1.BulkMuteFindingsResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/findings:bulkMute", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/findings:bulkMute", + "body": "*" + }, + { + "post": "/v1/{parent=projects/*}/findings:bulkMute", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.securitycenter.v1.BulkMuteFindingsResponse", + "metadata_type": "google.protobuf.Empty" + } + } + ] + }, + "CreateSource": { + "requestType": "CreateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/sources", + "(google.api.http).body": "source", + "(google.api.method_signature)": "parent,source" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/sources", + "body": "source" + } + }, + { + "(google.api.method_signature)": "parent,source" + } + ] + }, + "CreateFinding": { + "requestType": "CreateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings", + "(google.api.http).body": "finding", + "(google.api.method_signature)": "parent,finding_id,finding" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*/sources/*}/findings", + "body": "finding" + } + }, + { + "(google.api.method_signature)": "parent,finding_id,finding" + } + ] + }, + "CreateMuteConfig": { + "requestType": "CreateMuteConfigRequest", + "responseType": "MuteConfig", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/muteConfigs", + "(google.api.http).body": "mute_config", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/muteConfigs", + "(google.api.http).additional_bindings.body": "mute_config", + "(google.api.method_signature)": "parent,mute_config,mute_config_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/muteConfigs", + "body": "mute_config", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/muteConfigs", + "body": "mute_config" + }, + { + "post": "/v1/{parent=projects/*}/muteConfigs", + "body": "mute_config" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,mute_config" + }, + { + "(google.api.method_signature)": "parent,mute_config,mute_config_id" + } + ] + }, + "CreateNotificationConfig": { + "requestType": "CreateNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/notificationConfigs", + "(google.api.http).body": "notification_config", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/notificationConfigs", + "(google.api.http).additional_bindings.body": "notification_config", + "(google.api.method_signature)": "parent,notification_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/notificationConfigs", + "body": "notification_config", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/notificationConfigs", + "body": "notification_config" + }, + { + "post": "/v1/{parent=projects/*}/notificationConfigs", + "body": "notification_config" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,config_id,notification_config" + }, + { + "(google.api.method_signature)": "parent,notification_config" + } + ] + }, + "DeleteMuteConfig": { + "requestType": "DeleteMuteConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=organizations/*/muteConfigs/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/muteConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=organizations/*/muteConfigs/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=folders/*/muteConfigs/*}" + }, + { + "delete": "/v1/{name=projects/*/muteConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteNotificationConfig": { + "requestType": "DeleteNotificationConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=organizations/*/notificationConfigs/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/notificationConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=organizations/*/notificationConfigs/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=folders/*/notificationConfigs/*}" + }, + { + "delete": "/v1/{name=projects/*/notificationConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetBigQueryExport": { + "requestType": "GetBigQueryExportRequest", + "responseType": "BigQueryExport", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/bigQueryExports/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/bigQueryExports/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/bigQueryExports/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/bigQueryExports/*}" + }, + { + "get": "/v1/{name=projects/*/bigQueryExports/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=organizations/*/sources/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "GetMuteConfig": { + "requestType": "GetMuteConfigRequest", + "responseType": "MuteConfig", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/muteConfigs/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/muteConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/muteConfigs/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/muteConfigs/*}" + }, + { + "get": "/v1/{name=projects/*/muteConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetNotificationConfig": { + "requestType": "GetNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/notificationConfigs/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/notificationConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/notificationConfigs/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/notificationConfigs/*}" + }, + { + "get": "/v1/{name=projects/*/notificationConfigs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetOrganizationSettings": { + "requestType": "GetOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/organizationSettings}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/organizationSettings}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSource": { + "requestType": "GetSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/sources/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/sources/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GroupAssets": { + "requestType": "GroupAssetsRequest", + "responseType": "GroupAssetsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/assets:group", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/assets:group", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/assets:group", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/assets:group", + "body": "*" + }, + { + "post": "/v1/{parent=projects/*}/assets:group", + "body": "*" + } + ] + } + } + ] + }, + "GroupFindings": { + "requestType": "GroupFindingsRequest", + "responseType": "GroupFindingsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*/sources/*}/findings:group", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/sources/*}/findings:group", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,group_by" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*/sources/*}/findings:group", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*/sources/*}/findings:group", + "body": "*" + }, + { + "post": "/v1/{parent=projects/*/sources/*}/findings:group", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,group_by" + } + ] + }, + "ListAssets": { + "requestType": "ListAssetsRequest", + "responseType": "ListAssetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/assets", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/assets" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*}/assets", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/assets" + }, + { + "get": "/v1/{parent=projects/*}/assets" + } + ] + } + } + ] + }, + "ListFindings": { + "requestType": "ListFindingsRequest", + "responseType": "ListFindingsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*/sources/*}/findings", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/sources/*}/findings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*/sources/*}/findings", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*/sources/*}/findings" + }, + { + "get": "/v1/{parent=projects/*/sources/*}/findings" + } + ] + } + } + ] + }, + "ListMuteConfigs": { + "requestType": "ListMuteConfigsRequest", + "responseType": "ListMuteConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/muteConfigs", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/muteConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*}/muteConfigs", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/muteConfigs" + }, + { + "get": "/v1/{parent=projects/*}/muteConfigs" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListNotificationConfigs": { + "requestType": "ListNotificationConfigsRequest", + "responseType": "ListNotificationConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/notificationConfigs", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/notificationConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*}/notificationConfigs", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/notificationConfigs" + }, + { + "get": "/v1/{parent=projects/*}/notificationConfigs" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListSources": { + "requestType": "ListSourcesRequest", + "responseType": "ListSourcesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/sources", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/sources", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*}/sources", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/sources" + }, + { + "get": "/v1/{parent=projects/*}/sources" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RunAssetDiscovery": { + "requestType": "RunAssetDiscoveryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/assets:runDiscovery", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "google.cloud.securitycenter.v1.RunAssetDiscoveryResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/assets:runDiscovery", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.securitycenter.v1.RunAssetDiscoveryResponse", + "metadata_type": "google.protobuf.Empty" + } + } + ] + }, + "SetFindingState": { + "requestType": "SetFindingStateRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1/{name=organizations/*/sources/*/findings/*}:setState", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/sources/*/findings/*}:setState", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,state,start_time" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=organizations/*/sources/*/findings/*}:setState", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{name=folders/*/sources/*/findings/*}:setState", + "body": "*" + }, + { + "post": "/v1/{name=projects/*/sources/*/findings/*}:setState", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,state,start_time" + } + ] + }, + "SetMute": { + "requestType": "SetMuteRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1/{name=organizations/*/sources/*/findings/*}:setMute", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/sources/*/findings/*}:setMute", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,mute" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=organizations/*/sources/*/findings/*}:setMute", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{name=folders/*/sources/*/findings/*}:setMute", + "body": "*" + }, + { + "post": "/v1/{name=projects/*/sources/*/findings/*}:setMute", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,mute" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=organizations/*/sources/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=organizations/*/sources/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=organizations/*/sources/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + }, + "UpdateExternalSystem": { + "requestType": "UpdateExternalSystemRequest", + "responseType": "ExternalSystem", + "options": { + "(google.api.http).patch": "/v1/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}", + "(google.api.http).body": "external_system", + "(google.api.http).additional_bindings.patch": "/v1/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}", + "(google.api.http).additional_bindings.body": "external_system", + "(google.api.method_signature)": "external_system,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}", + "body": "external_system", + "additional_bindings": [ + { + "patch": "/v1/{external_system.name=folders/*/sources/*/findings/*/externalSystems/*}", + "body": "external_system" + }, + { + "patch": "/v1/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}", + "body": "external_system" + } + ] + } + }, + { + "(google.api.method_signature)": "external_system,update_mask" + } + ] + }, + "UpdateFinding": { + "requestType": "UpdateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).patch": "/v1/{finding.name=organizations/*/sources/*/findings/*}", + "(google.api.http).body": "finding", + "(google.api.http).additional_bindings.patch": "/v1/{finding.name=projects/*/sources/*/findings/*}", + "(google.api.http).additional_bindings.body": "finding", + "(google.api.method_signature)": "finding" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{finding.name=organizations/*/sources/*/findings/*}", + "body": "finding", + "additional_bindings": [ + { + "patch": "/v1/{finding.name=folders/*/sources/*/findings/*}", + "body": "finding" + }, + { + "patch": "/v1/{finding.name=projects/*/sources/*/findings/*}", + "body": "finding" + } + ] + } + }, + { + "(google.api.method_signature)": "finding" + } + ] + }, + "UpdateMuteConfig": { + "requestType": "UpdateMuteConfigRequest", + "responseType": "MuteConfig", + "options": { + "(google.api.http).patch": "/v1/{mute_config.name=organizations/*/muteConfigs/*}", + "(google.api.http).body": "mute_config", + "(google.api.http).additional_bindings.patch": "/v1/{mute_config.name=projects/*/muteConfigs/*}", + "(google.api.http).additional_bindings.body": "mute_config", + "(google.api.method_signature)": "mute_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{mute_config.name=organizations/*/muteConfigs/*}", + "body": "mute_config", + "additional_bindings": [ + { + "patch": "/v1/{mute_config.name=folders/*/muteConfigs/*}", + "body": "mute_config" + }, + { + "patch": "/v1/{mute_config.name=projects/*/muteConfigs/*}", + "body": "mute_config" + } + ] + } + }, + { + "(google.api.method_signature)": "mute_config,update_mask" + } + ] + }, + "UpdateNotificationConfig": { + "requestType": "UpdateNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).patch": "/v1/{notification_config.name=organizations/*/notificationConfigs/*}", + "(google.api.http).body": "notification_config", + "(google.api.http).additional_bindings.patch": "/v1/{notification_config.name=projects/*/notificationConfigs/*}", + "(google.api.http).additional_bindings.body": "notification_config", + "(google.api.method_signature)": "notification_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{notification_config.name=organizations/*/notificationConfigs/*}", + "body": "notification_config", + "additional_bindings": [ + { + "patch": "/v1/{notification_config.name=folders/*/notificationConfigs/*}", + "body": "notification_config" + }, + { + "patch": "/v1/{notification_config.name=projects/*/notificationConfigs/*}", + "body": "notification_config" + } + ] + } + }, + { + "(google.api.method_signature)": "notification_config" + }, + { + "(google.api.method_signature)": "notification_config,update_mask" + } + ] + }, + "UpdateOrganizationSettings": { + "requestType": "UpdateOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "options": { + "(google.api.http).patch": "/v1/{organization_settings.name=organizations/*/organizationSettings}", + "(google.api.http).body": "organization_settings", + "(google.api.method_signature)": "organization_settings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{organization_settings.name=organizations/*/organizationSettings}", + "body": "organization_settings" + } + }, + { + "(google.api.method_signature)": "organization_settings" + } + ] + }, + "UpdateSource": { + "requestType": "UpdateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).patch": "/v1/{source.name=organizations/*/sources/*}", + "(google.api.http).body": "source", + "(google.api.method_signature)": "source" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{source.name=organizations/*/sources/*}", + "body": "source" + } + }, + { + "(google.api.method_signature)": "source" + } + ] + }, + "UpdateSecurityMarks": { + "requestType": "UpdateSecurityMarksRequest", + "responseType": "SecurityMarks", + "options": { + "(google.api.http).patch": "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}", + "(google.api.http).body": "security_marks", + "(google.api.http).additional_bindings.patch": "/v1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}", + "(google.api.http).additional_bindings.body": "security_marks", + "(google.api.method_signature)": "security_marks" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}", + "body": "security_marks", + "additional_bindings": [ + { + "patch": "/v1/{security_marks.name=folders/*/assets/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1/{security_marks.name=projects/*/assets/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + } + ] + } + }, + { + "(google.api.method_signature)": "security_marks" + } + ] + }, + "CreateBigQueryExport": { + "requestType": "CreateBigQueryExportRequest", + "responseType": "BigQueryExport", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*}/bigQueryExports", + "(google.api.http).body": "big_query_export", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/bigQueryExports", + "(google.api.http).additional_bindings.body": "big_query_export", + "(google.api.method_signature)": "parent,big_query_export,big_query_export_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*}/bigQueryExports", + "body": "big_query_export", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/bigQueryExports", + "body": "big_query_export" + }, + { + "post": "/v1/{parent=projects/*}/bigQueryExports", + "body": "big_query_export" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,big_query_export,big_query_export_id" + } + ] + }, + "DeleteBigQueryExport": { + "requestType": "DeleteBigQueryExportRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=organizations/*/bigQueryExports/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/bigQueryExports/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=organizations/*/bigQueryExports/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=folders/*/bigQueryExports/*}" + }, + { + "delete": "/v1/{name=projects/*/bigQueryExports/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBigQueryExport": { + "requestType": "UpdateBigQueryExportRequest", + "responseType": "BigQueryExport", + "options": { + "(google.api.http).patch": "/v1/{big_query_export.name=organizations/*/bigQueryExports/*}", + "(google.api.http).body": "big_query_export", + "(google.api.http).additional_bindings.patch": "/v1/{big_query_export.name=projects/*/bigQueryExports/*}", + "(google.api.http).additional_bindings.body": "big_query_export", + "(google.api.method_signature)": "big_query_export,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{big_query_export.name=organizations/*/bigQueryExports/*}", + "body": "big_query_export", + "additional_bindings": [ + { + "patch": "/v1/{big_query_export.name=folders/*/bigQueryExports/*}", + "body": "big_query_export" + }, + { + "patch": "/v1/{big_query_export.name=projects/*/bigQueryExports/*}", + "body": "big_query_export" + } + ] + } + }, + { + "(google.api.method_signature)": "big_query_export,update_mask" + } + ] + }, + "ListBigQueryExports": { + "requestType": "ListBigQueryExportsRequest", + "responseType": "ListBigQueryExportsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*}/bigQueryExports", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/bigQueryExports", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*}/bigQueryExports", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/bigQueryExports" + }, + { + "get": "/v1/{parent=projects/*}/bigQueryExports" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "BulkMuteFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "muteAnnotation": { + "type": "string", + "id": 3, + "options": { + "deprecated": true + } + } + } + }, + "BulkMuteFindingsResponse": { + "fields": {} + }, + "CreateFindingRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + }, + "findingId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "finding": { + "type": "Finding", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateMuteConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/MuteConfig" + } + }, + "muteConfig": { + "type": "MuteConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "muteConfigId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateNotificationConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" + } + }, + "configId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "notificationConfig": { + "type": "NotificationConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateSourceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "source": { + "type": "Source", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteMuteConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/MuteConfig" + } + } + } + }, + "DeleteNotificationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" + } + } + } + }, + "GetBigQueryExportRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/BigQueryExport" + } + } + } + }, + "GetMuteConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/MuteConfig" + } + } + } + }, + "GetNotificationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" + } + } + } + }, + "GetOrganizationSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/OrganizationSettings" + } + } + } + }, + "GetSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + } + } + }, + "GroupAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Asset" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "groupBy": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 7 + }, + "pageSize": { + "type": "int32", + "id": 8 + } + } + }, + "GroupAssetsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + } + }, + "GroupFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "groupBy": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 7 + }, + "pageSize": { + "type": "int32", + "id": 8 + } + } + }, + "GroupFindingsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + } + }, + "GroupResult": { + "fields": { + "properties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + } + } + }, + "ListMuteConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/MuteConfig" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListMuteConfigsResponse": { + "fields": { + "muteConfigs": { + "rule": "repeated", + "type": "MuteConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListNotificationConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/NotificationConfig" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListNotificationConfigsResponse": { + "fields": { + "notificationConfigs": { + "rule": "repeated", + "type": "NotificationConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Source" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 7 + } + } + }, + "ListSourcesResponse": { + "fields": { + "sources": { + "rule": "repeated", + "type": "Source", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Asset" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "pageToken": { + "type": "string", + "id": 8 + }, + "pageSize": { + "type": "int32", + "id": 9 + } + } + }, + "ListAssetsResponse": { + "fields": { + "listAssetsResults": { + "rule": "repeated", + "type": "ListAssetsResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "ListAssetsResult": { + "fields": { + "asset": { + "type": "Asset", + "id": 1 + }, + "stateChange": { + "type": "StateChange", + "id": 2 + } + }, + "nested": { + "StateChange": { + "values": { + "UNUSED": 0, + "ADDED": 1, + "REMOVED": 2, + "ACTIVE": 3 + } + } + } + } + } + }, + "ListFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "pageToken": { + "type": "string", + "id": 8 + }, + "pageSize": { + "type": "int32", + "id": 9 + } + } + }, + "ListFindingsResponse": { + "fields": { + "listFindingsResults": { + "rule": "repeated", + "type": "ListFindingsResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "ListFindingsResult": { + "fields": { + "finding": { + "type": "Finding", + "id": 1 + }, + "stateChange": { + "type": "StateChange", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "StateChange": { + "values": { + "UNUSED": 0, + "CHANGED": 1, + "UNCHANGED": 2, + "ADDED": 3, + "REMOVED": 4 + } + }, + "Resource": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 8 + }, + "type": { + "type": "string", + "id": 6 + }, + "projectName": { + "type": "string", + "id": 2 + }, + "projectDisplayName": { + "type": "string", + "id": 3 + }, + "parentName": { + "type": "string", + "id": 4 + }, + "parentDisplayName": { + "type": "string", + "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 7 + } + } + } + } + } + } + }, + "SetFindingStateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Finding" + } + }, + "state": { + "type": "Finding.State", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetMuteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Finding" + } + }, + "mute": { + "type": "Finding.Mute", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RunAssetDiscoveryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + } + } + }, + "UpdateExternalSystemRequest": { + "fields": { + "externalSystem": { + "type": "ExternalSystem", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateFindingRequest": { + "fields": { + "finding": { + "type": "Finding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateMuteConfigRequest": { + "fields": { + "muteConfig": { + "type": "MuteConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateNotificationConfigRequest": { + "fields": { + "notificationConfig": { + "type": "NotificationConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateOrganizationSettingsRequest": { + "fields": { + "organizationSettings": { + "type": "OrganizationSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateSourceRequest": { + "fields": { + "source": { + "type": "Source", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateSecurityMarksRequest": { + "fields": { + "securityMarks": { + "type": "SecurityMarks", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "CreateBigQueryExportRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/BigQueryExport" + } + }, + "bigQueryExport": { + "type": "BigQueryExport", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "bigQueryExportId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateBigQueryExportRequest": { + "fields": { + "bigQueryExport": { + "type": "BigQueryExport", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "ListBigQueryExportsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/BigQueryExport" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListBigQueryExportsResponse": { + "fields": { + "bigQueryExports": { + "rule": "repeated", + "type": "BigQueryExport", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteBigQueryExportRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/BigQueryExport" + } + } + } + }, + "Source": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Source", + "(google.api.resource).pattern": "projects/{project}/sources/{source}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "canonicalName": { + "type": "string", + "id": 14 + } + } + } + } + }, + "v1beta1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter", + "java_multiple_files": true, + "java_package": "com.google.cloud.securitycenter.v1beta1" + }, + "nested": { + "Asset": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Asset", + "(google.api.resource).pattern": "organizations/{organization}/assets/{asset}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "securityCenterProperties": { + "type": "SecurityCenterProperties", + "id": 2 + }, + "resourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "SecurityCenterProperties": { + "fields": { + "resourceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "resourceType": { + "type": "string", + "id": 2 + }, + "resourceParent": { + "type": "string", + "id": 3 + }, + "resourceProject": { + "type": "string", + "id": 4 + }, + "resourceOwners": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + } + } + }, + "SecurityMarks": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marks": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "Finding": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Finding", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}/findings/{finding}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "resourceName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + }, + "category": { + "type": "string", + "id": 5 + }, + "externalUri": { + "type": "string", + "id": 6 + }, + "sourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2 + } + } + } + }, + "OrganizationSettings": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/OrganizationSettings", + "(google.api.resource).pattern": "organizations/{organization}/organizationSettings" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "enableAssetDiscovery": { + "type": "bool", + "id": 2 + }, + "assetDiscoveryConfig": { + "type": "AssetDiscoveryConfig", + "id": 3 + } + }, + "nested": { + "AssetDiscoveryConfig": { + "fields": { + "projectIds": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "inclusionMode": { + "type": "InclusionMode", + "id": 2 + } + }, + "nested": { + "InclusionMode": { + "values": { + "INCLUSION_MODE_UNSPECIFIED": 0, + "INCLUDE_ONLY": 1, + "EXCLUDE": 2 + } + } + } + } + } + }, + "RunAssetDiscoveryResponse": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "COMPLETED": 1, + "SUPERSEDED": 2, + "TERMINATED": 3 + } + } + } + }, + "SecurityCenter": { + "options": { + "(google.api.default_host)": "securitycenter.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateSource": { + "requestType": "CreateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).post": "/v1beta1/{parent=organizations/*}/sources", + "(google.api.http).body": "source", + "(google.api.method_signature)": "parent,source" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=organizations/*}/sources", + "body": "source" + } + }, + { + "(google.api.method_signature)": "parent,source" + } + ] + }, + "CreateFinding": { + "requestType": "CreateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1beta1/{parent=organizations/*/sources/*}/findings", + "(google.api.http).body": "finding", + "(google.api.method_signature)": "parent,finding_id,finding" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=organizations/*/sources/*}/findings", + "body": "finding" + } + }, + { + "(google.api.method_signature)": "parent,finding_id,finding" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1beta1/{resource=organizations/*/sources/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{resource=organizations/*/sources/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "GetOrganizationSettings": { + "requestType": "GetOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "options": { + "(google.api.http).get": "/v1beta1/{name=organizations/*/organizationSettings}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=organizations/*/organizationSettings}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSource": { + "requestType": "GetSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).get": "/v1beta1/{name=organizations/*/sources/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=organizations/*/sources/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GroupAssets": { + "requestType": "GroupAssetsRequest", + "responseType": "GroupAssetsResponse", + "options": { + "(google.api.http).post": "/v1beta1/{parent=organizations/*}/assets:group", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=organizations/*}/assets:group", + "body": "*" + } + } + ] + }, + "GroupFindings": { + "requestType": "GroupFindingsRequest", + "responseType": "GroupFindingsResponse", + "options": { + "(google.api.http).post": "/v1beta1/{parent=organizations/*/sources/*}/findings:group", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,group_by" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=organizations/*/sources/*}/findings:group", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,group_by" + } + ] + }, + "ListAssets": { + "requestType": "ListAssetsRequest", + "responseType": "ListAssetsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=organizations/*}/assets" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=organizations/*}/assets" + } + } + ] + }, + "ListFindings": { + "requestType": "ListFindingsRequest", + "responseType": "ListFindingsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=organizations/*/sources/*}/findings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=organizations/*/sources/*}/findings" + } + } + ] + }, + "ListSources": { + "requestType": "ListSourcesRequest", + "responseType": "ListSourcesResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=organizations/*}/sources", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=organizations/*}/sources" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RunAssetDiscovery": { + "requestType": "RunAssetDiscoveryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=organizations/*}/assets:runDiscovery", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=organizations/*}/assets:runDiscovery", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Empty" + } + } + ] + }, + "SetFindingState": { + "requestType": "SetFindingStateRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1beta1/{name=organizations/*/sources/*/findings/*}:setState", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,state,start_time" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=organizations/*/sources/*/findings/*}:setState", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,state,start_time" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1beta1/{resource=organizations/*/sources/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{resource=organizations/*/sources/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1beta1/{resource=organizations/*/sources/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{resource=organizations/*/sources/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + }, + "UpdateFinding": { + "requestType": "UpdateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).patch": "/v1beta1/{finding.name=organizations/*/sources/*/findings/*}", + "(google.api.http).body": "finding", + "(google.api.method_signature)": "finding" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{finding.name=organizations/*/sources/*/findings/*}", + "body": "finding" + } + }, + { + "(google.api.method_signature)": "finding" + } + ] + }, + "UpdateOrganizationSettings": { + "requestType": "UpdateOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "options": { + "(google.api.http).patch": "/v1beta1/{organization_settings.name=organizations/*/organizationSettings}", + "(google.api.http).body": "organization_settings", + "(google.api.method_signature)": "organization_settings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{organization_settings.name=organizations/*/organizationSettings}", + "body": "organization_settings" + } + }, + { + "(google.api.method_signature)": "organization_settings" + } + ] + }, + "UpdateSource": { + "requestType": "UpdateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).patch": "/v1beta1/{source.name=organizations/*/sources/*}", + "(google.api.http).body": "source", + "(google.api.method_signature)": "source" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{source.name=organizations/*/sources/*}", + "body": "source" + } + }, + { + "(google.api.method_signature)": "source" + } + ] + }, + "UpdateSecurityMarks": { + "requestType": "UpdateSecurityMarksRequest", + "responseType": "SecurityMarks", + "options": { + "(google.api.http).patch": "/v1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}", + "(google.api.http).body": "security_marks", + "(google.api.http).additional_bindings.patch": "/v1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "(google.api.http).additional_bindings.body": "security_marks", + "(google.api.method_signature)": "security_marks" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}", + "body": "security_marks", + "additional_bindings": { + "patch": "/v1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + } + } + }, + { + "(google.api.method_signature)": "security_marks" + } + ] + } + } + }, + "CreateFindingRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + }, + "findingId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "finding": { + "type": "Finding", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateSourceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "source": { + "type": "Source", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetOrganizationSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/OrganizationSettings" + } + } + } + }, + "GetSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + } + } + }, + "GroupAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "groupBy": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 7 + }, + "pageSize": { + "type": "int32", + "id": 8 + } + } + }, + "GroupAssetsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "GroupFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "groupBy": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + }, + "pageSize": { + "type": "int32", + "id": 6 + } + } + }, + "GroupFindingsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "GroupResult": { + "fields": { + "properties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + } + } + }, + "ListSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 7 + } + } + }, + "ListSourcesResponse": { + "fields": { + "sources": { + "rule": "repeated", + "type": "Source", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 8 + }, + "pageSize": { + "type": "int32", + "id": 9 + } + } + }, + "ListAssetsResponse": { + "fields": { + "listAssetsResults": { + "rule": "repeated", + "type": "ListAssetsResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "ListAssetsResult": { + "fields": { + "asset": { + "type": "Asset", + "id": 1 + }, + "state": { + "type": "State", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "UNUSED": 1, + "ADDED": 2, + "REMOVED": 3, + "ACTIVE": 4 + } + } + } + } + } + }, + "ListFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 6 + }, + "pageSize": { + "type": "int32", + "id": 7 + } + } + }, + "ListFindingsResponse": { + "fields": { + "findings": { + "rule": "repeated", + "type": "Finding", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + } + }, + "SetFindingStateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Finding" + } + }, + "state": { + "type": "Finding.State", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RunAssetDiscoveryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + } + } + }, + "UpdateFindingRequest": { + "fields": { + "finding": { + "type": "Finding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateOrganizationSettingsRequest": { + "fields": { + "organizationSettings": { + "type": "OrganizationSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateSourceRequest": { + "fields": { + "source": { + "type": "Source", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateSecurityMarksRequest": { + "fields": { + "securityMarks": { + "type": "SecurityMarks", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "Source": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Source", + "(google.api.resource).pattern": "organizations/{organization}/sources/{source}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + } + } + } + }, + "v1p1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.SecurityCenter.V1P1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter", + "java_multiple_files": true, + "java_package": "com.google.cloud.securitycenter.v1p1beta1", + "php_namespace": "Google\\Cloud\\SecurityCenter\\V1p1beta1", + "ruby_package": "Google::Cloud::SecurityCenter::V1p1beta1", + "java_outer_classname": "ResourceProto", + "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic", + "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}" + }, + "nested": { + "Asset": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Asset", + "(google.api.resource).pattern": "projects/{project}/assets/{asset}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "securityCenterProperties": { + "type": "SecurityCenterProperties", + "id": 2 + }, + "resourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "iamPolicy": { + "type": "IamPolicy", + "id": 11 + }, + "canonicalName": { + "type": "string", + "id": 13 + } + }, + "nested": { + "SecurityCenterProperties": { + "fields": { + "resourceName": { + "type": "string", + "id": 1 + }, + "resourceType": { + "type": "string", + "id": 2 + }, + "resourceParent": { + "type": "string", + "id": 3 + }, + "resourceProject": { + "type": "string", + "id": 4 + }, + "resourceOwners": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "resourceDisplayName": { + "type": "string", + "id": 6 + }, + "resourceParentDisplayName": { + "type": "string", + "id": 7 + }, + "resourceProjectDisplayName": { + "type": "string", + "id": 8 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 10 + } + } + }, + "IamPolicy": { + "fields": { + "policyBlob": { + "type": "string", + "id": 1 + } + } + } + } + }, + "Folder": { + "fields": { + "resourceFolder": { + "type": "string", + "id": 1 + }, + "resourceFolderDisplayName": { + "type": "string", + "id": 2 + } + } + }, + "SecurityMarks": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/SecurityMarks", + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}/securityMarks" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marks": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "canonicalName": { + "type": "string", + "id": 3 + } + } + }, + "Finding": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Finding", + "(google.api.resource).pattern": "projects/{project}/sources/{source}/findings/{finding}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "resourceName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + }, + "category": { + "type": "string", + "id": 5 + }, + "externalUri": { + "type": "string", + "id": 6 + }, + "sourceProperties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 7 + }, + "securityMarks": { + "type": "SecurityMarks", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "severity": { + "type": "Severity", + "id": 13 + }, + "canonicalName": { + "type": "string", + "id": 14 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2 + } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "CRITICAL": 1, + "HIGH": 2, + "MEDIUM": 3, + "LOW": 4 + } + } + } + }, + "NotificationConfig": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/NotificationConfig", + "(google.api.resource).pattern": "organizations/{organization}/notificationConfigs/{notification_config}" + }, + "oneofs": { + "notifyConfig": { + "oneof": [ + "streamingConfig" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "eventType": { + "type": "EventType", + "id": 3 + }, + "pubsubTopic": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "serviceAccount": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "streamingConfig": { + "type": "StreamingConfig", + "id": 6 + } + }, + "nested": { + "StreamingConfig": { + "fields": { + "filter": { + "type": "string", + "id": 1 + } + } + }, + "EventType": { + "values": { + "EVENT_TYPE_UNSPECIFIED": 0, + "FINDING": 1 + } + } + } + }, + "NotificationMessage": { + "oneofs": { + "event": { + "oneof": [ + "finding" + ] + } + }, + "fields": { + "notificationConfigName": { + "type": "string", + "id": 1 + }, + "finding": { + "type": "Finding", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + } + } + }, + "Resource": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "project": { + "type": "string", + "id": 2 + }, + "projectDisplayName": { + "type": "string", + "id": 3 + }, + "parent": { + "type": "string", + "id": 4 + }, + "parentDisplayName": { + "type": "string", + "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "OrganizationSettings": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/OrganizationSettings", + "(google.api.resource).pattern": "organizations/{organization}/organizationSettings" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "enableAssetDiscovery": { + "type": "bool", + "id": 2 + }, + "assetDiscoveryConfig": { + "type": "AssetDiscoveryConfig", + "id": 3 + } + }, + "nested": { + "AssetDiscoveryConfig": { + "fields": { + "projectIds": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "inclusionMode": { + "type": "InclusionMode", + "id": 2 + }, + "folderIds": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "InclusionMode": { + "values": { + "INCLUSION_MODE_UNSPECIFIED": 0, + "INCLUDE_ONLY": 1, + "EXCLUDE": 2 + } + } + } + } + } + }, + "RunAssetDiscoveryResponse": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "COMPLETED": 1, + "SUPERSEDED": 2, + "TERMINATED": 3 + } + } + } + }, + "SecurityCenter": { + "options": { + "(google.api.default_host)": "securitycenter.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateSource": { + "requestType": "CreateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/sources", + "(google.api.http).body": "source", + "(google.api.method_signature)": "parent,source" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=organizations/*}/sources", + "body": "source" + } + }, + { + "(google.api.method_signature)": "parent,source" + } + ] + }, + "CreateFinding": { + "requestType": "CreateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=organizations/*/sources/*}/findings", + "(google.api.http).body": "finding", + "(google.api.method_signature)": "parent,finding,finding_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=organizations/*/sources/*}/findings", + "body": "finding" + } + }, + { + "(google.api.method_signature)": "parent,finding_id,finding" + }, + { + "(google.api.method_signature)": "parent,finding,finding_id" + } + ] + }, + "CreateNotificationConfig": { + "requestType": "CreateNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/notificationConfigs", + "(google.api.http).body": "notification_config", + "(google.api.method_signature)": "parent,notification_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=organizations/*}/notificationConfigs", + "body": "notification_config" + } + }, + { + "(google.api.method_signature)": "parent,config_id,notification_config" + }, + { + "(google.api.method_signature)": "parent,notification_config" + } + ] + }, + "DeleteNotificationConfig": { + "requestType": "DeleteNotificationConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p1beta1/{name=organizations/*/notificationConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1p1beta1/{name=organizations/*/notificationConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1p1beta1/{resource=organizations/*/sources/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{resource=organizations/*/sources/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "GetNotificationConfig": { + "requestType": "GetNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).get": "/v1p1beta1/{name=organizations/*/notificationConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{name=organizations/*/notificationConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetOrganizationSettings": { + "requestType": "GetOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "options": { + "(google.api.http).get": "/v1p1beta1/{name=organizations/*/organizationSettings}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{name=organizations/*/organizationSettings}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSource": { + "requestType": "GetSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).get": "/v1p1beta1/{name=organizations/*/sources/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{name=organizations/*/sources/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GroupAssets": { + "requestType": "GroupAssetsRequest", + "responseType": "GroupAssetsResponse", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/assets:group", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1p1beta1/{parent=projects/*}/assets:group", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=organizations/*}/assets:group", + "body": "*", + "additional_bindings": [ + { + "post": "/v1p1beta1/{parent=folders/*}/assets:group", + "body": "*" + }, + { + "post": "/v1p1beta1/{parent=projects/*}/assets:group", + "body": "*" + } + ] + } + } + ] + }, + "GroupFindings": { + "requestType": "GroupFindingsRequest", + "responseType": "GroupFindingsResponse", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=organizations/*/sources/*}/findings:group", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1p1beta1/{parent=projects/*/sources/*}/findings:group", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,group_by" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=organizations/*/sources/*}/findings:group", + "body": "*", + "additional_bindings": [ + { + "post": "/v1p1beta1/{parent=folders/*/sources/*}/findings:group", + "body": "*" + }, + { + "post": "/v1p1beta1/{parent=projects/*/sources/*}/findings:group", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,group_by" + } + ] + }, + "ListAssets": { + "requestType": "ListAssetsRequest", + "responseType": "ListAssetsResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{parent=organizations/*}/assets", + "(google.api.http).additional_bindings.get": "/v1p1beta1/{parent=projects/*}/assets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{parent=organizations/*}/assets", + "additional_bindings": [ + { + "get": "/v1p1beta1/{parent=folders/*}/assets" + }, + { + "get": "/v1p1beta1/{parent=projects/*}/assets" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListFindings": { + "requestType": "ListFindingsRequest", + "responseType": "ListFindingsResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{parent=organizations/*/sources/*}/findings", + "(google.api.http).additional_bindings.get": "/v1p1beta1/{parent=projects/*/sources/*}/findings", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{parent=organizations/*/sources/*}/findings", + "additional_bindings": [ + { + "get": "/v1p1beta1/{parent=folders/*/sources/*}/findings" + }, + { + "get": "/v1p1beta1/{parent=projects/*/sources/*}/findings" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListNotificationConfigs": { + "requestType": "ListNotificationConfigsRequest", + "responseType": "ListNotificationConfigsResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{parent=organizations/*}/notificationConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{parent=organizations/*}/notificationConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListSources": { + "requestType": "ListSourcesRequest", + "responseType": "ListSourcesResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{parent=organizations/*}/sources", + "(google.api.http).additional_bindings.get": "/v1p1beta1/{parent=projects/*}/sources", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{parent=organizations/*}/sources", + "additional_bindings": [ + { + "get": "/v1p1beta1/{parent=folders/*}/sources" + }, + { + "get": "/v1p1beta1/{parent=projects/*}/sources" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RunAssetDiscovery": { + "requestType": "RunAssetDiscoveryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p1beta1/{parent=organizations/*}/assets:runDiscovery", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Empty" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{parent=organizations/*}/assets:runDiscovery", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse", + "metadata_type": "google.protobuf.Empty" + } + } + ] + }, + "SetFindingState": { + "requestType": "SetFindingStateRequest", + "responseType": "Finding", + "options": { + "(google.api.http).post": "/v1p1beta1/{name=organizations/*/sources/*/findings/*}:setState", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1p1beta1/{name=projects/*/sources/*/findings/*}:setState", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,state,start_time" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{name=organizations/*/sources/*/findings/*}:setState", + "body": "*", + "additional_bindings": [ + { + "post": "/v1p1beta1/{name=folders/*/sources/*/findings/*}:setState", + "body": "*" + }, + { + "post": "/v1p1beta1/{name=projects/*/sources/*/findings/*}:setState", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,state,start_time" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1p1beta1/{resource=organizations/*/sources/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{resource=organizations/*/sources/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1p1beta1/{resource=organizations/*/sources/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/{resource=organizations/*/sources/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + }, + "UpdateFinding": { + "requestType": "UpdateFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).patch": "/v1p1beta1/{finding.name=organizations/*/sources/*/findings/*}", + "(google.api.http).body": "finding", + "(google.api.http).additional_bindings.patch": "/v1p1beta1/{finding.name=projects/*/sources/*/findings/*}", + "(google.api.http).additional_bindings.body": "finding", + "(google.api.method_signature)": "finding,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p1beta1/{finding.name=organizations/*/sources/*/findings/*}", + "body": "finding", + "additional_bindings": [ + { + "patch": "/v1p1beta1/{finding.name=folders/*/sources/*/findings/*}", + "body": "finding" + }, + { + "patch": "/v1p1beta1/{finding.name=projects/*/sources/*/findings/*}", + "body": "finding" + } + ] + } + }, + { + "(google.api.method_signature)": "finding" + }, + { + "(google.api.method_signature)": "finding,update_mask" + } + ] + }, + "UpdateNotificationConfig": { + "requestType": "UpdateNotificationConfigRequest", + "responseType": "NotificationConfig", + "options": { + "(google.api.http).patch": "/v1p1beta1/{notification_config.name=organizations/*/notificationConfigs/*}", + "(google.api.http).body": "notification_config", + "(google.api.method_signature)": "notification_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p1beta1/{notification_config.name=organizations/*/notificationConfigs/*}", + "body": "notification_config" + } + }, + { + "(google.api.method_signature)": "notification_config" + }, + { + "(google.api.method_signature)": "notification_config,update_mask" + } + ] + }, + "UpdateOrganizationSettings": { + "requestType": "UpdateOrganizationSettingsRequest", + "responseType": "OrganizationSettings", + "options": { + "(google.api.http).patch": "/v1p1beta1/{organization_settings.name=organizations/*/organizationSettings}", + "(google.api.http).body": "organization_settings", + "(google.api.method_signature)": "organization_settings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p1beta1/{organization_settings.name=organizations/*/organizationSettings}", + "body": "organization_settings" + } + }, + { + "(google.api.method_signature)": "organization_settings" + } + ] + }, + "UpdateSource": { + "requestType": "UpdateSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).patch": "/v1p1beta1/{source.name=organizations/*/sources/*}", + "(google.api.http).body": "source", + "(google.api.method_signature)": "source,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p1beta1/{source.name=organizations/*/sources/*}", + "body": "source" + } + }, + { + "(google.api.method_signature)": "source" + }, + { + "(google.api.method_signature)": "source,update_mask" + } + ] + }, + "UpdateSecurityMarks": { + "requestType": "UpdateSecurityMarksRequest", + "responseType": "SecurityMarks", + "options": { + "(google.api.http).patch": "/v1p1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}", + "(google.api.http).body": "security_marks", + "(google.api.http).additional_bindings.patch": "/v1p1beta1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}", + "(google.api.http).additional_bindings.body": "security_marks", + "(google.api.method_signature)": "security_marks,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}", + "body": "security_marks", + "additional_bindings": [ + { + "patch": "/v1p1beta1/{security_marks.name=folders/*/assets/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1p1beta1/{security_marks.name=projects/*/assets/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1p1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1p1beta1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + }, + { + "patch": "/v1p1beta1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}", + "body": "security_marks" + } + ] + } + }, + { + "(google.api.method_signature)": "security_marks" + }, + { + "(google.api.method_signature)": "security_marks,update_mask" + } + ] + } + } + }, + "CreateFindingRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + }, + "findingId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "finding": { + "type": "Finding", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateNotificationConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "configId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "notificationConfig": { + "type": "NotificationConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateSourceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "source": { + "type": "Source", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteNotificationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" + } + } + } + }, + "GetNotificationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/NotificationConfig" + } + } + } + }, + "GetOrganizationSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/OrganizationSettings" + } + } + } + }, + "GetSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + } + } + }, + "GroupAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Asset" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "groupBy": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 7 + }, + "pageSize": { + "type": "int32", + "id": 8 + } + } + }, + "GroupAssetsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + } + }, + "GroupFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "groupBy": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 7 + }, + "pageSize": { + "type": "int32", + "id": 8 + } + } + }, + "GroupFindingsResponse": { + "fields": { + "groupByResults": { + "rule": "repeated", + "type": "GroupResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + } + }, + "GroupResult": { + "fields": { + "properties": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + } + } + }, + "ListNotificationConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListNotificationConfigsResponse": { + "fields": { + "notificationConfigs": { + "rule": "repeated", + "type": "NotificationConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Source" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 7 + } + } + }, + "ListSourcesResponse": { + "fields": { + "sources": { + "rule": "repeated", + "type": "Source", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "securitycenter.googleapis.com/Asset" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "pageToken": { + "type": "string", + "id": 8 + }, + "pageSize": { + "type": "int32", + "id": 9 + } + } + }, + "ListAssetsResponse": { + "fields": { + "listAssetsResults": { + "rule": "repeated", + "type": "ListAssetsResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "ListAssetsResult": { + "fields": { + "asset": { + "type": "Asset", + "id": 1 + }, + "stateChange": { + "type": "StateChange", + "id": 2 + } + }, + "nested": { + "StateChange": { + "values": { + "UNUSED": 0, + "ADDED": 1, + "REMOVED": 2, + "ACTIVE": 3 + } + } + } + } + } + }, + "ListFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Source" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "compareDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "pageToken": { + "type": "string", + "id": 8 + }, + "pageSize": { + "type": "int32", + "id": 9 + } + } + }, + "ListFindingsResponse": { + "fields": { + "listFindingsResults": { + "rule": "repeated", + "type": "ListFindingsResult", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalSize": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "ListFindingsResult": { + "fields": { + "finding": { + "type": "Finding", + "id": 1 + }, + "stateChange": { + "type": "StateChange", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Resource": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "projectName": { + "type": "string", + "id": 2 + }, + "projectDisplayName": { + "type": "string", + "id": 3 + }, + "parentName": { + "type": "string", + "id": 4 + }, + "parentDisplayName": { + "type": "string", + "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 10 + } + } + }, + "StateChange": { + "values": { + "UNUSED": 0, + "CHANGED": 1, + "UNCHANGED": 2, + "ADDED": 3, + "REMOVED": 4 + } + } + } + } + } + }, + "SetFindingStateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "securitycenter.googleapis.com/Finding" + } + }, + "state": { + "type": "Finding.State", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RunAssetDiscoveryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + } + } + }, + "UpdateFindingRequest": { + "fields": { + "finding": { + "type": "Finding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateNotificationConfigRequest": { + "fields": { + "notificationConfig": { + "type": "NotificationConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateOrganizationSettingsRequest": { + "fields": { + "organizationSettings": { + "type": "OrganizationSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateSourceRequest": { + "fields": { + "source": { + "type": "Source", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateSecurityMarksRequest": { + "fields": { + "securityMarks": { + "type": "SecurityMarks", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "Source": { + "options": { + "(google.api.resource).type": "securitycenter.googleapis.com/Source", + "(google.api.resource).pattern": "projects/{project}/sources/{source}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "canonicalName": { + "type": "string", + "id": 14 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "cc_enable_arenas": true, + "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" + }, + "nested": { + "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 + } + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "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 + } + } + } + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/samples/.eslintrc.yml b/packages/google-cloud-securitycenter/samples/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-securitycenter/samples/README.md b/packages/google-cloud-securitycenter/samples/README.md new file mode 100644 index 00000000000..b62afb4b600 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/README.md @@ -0,0 +1,58 @@ +[//]: # "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 + +# [Google Cloud Security Command Center: Node.js Samples](https://github.com/googleapis/nodejs-security-center) + +[![Open in Cloud Shell][shell_img]][shell_link] + +> Node.js idiomatic client for [Cloud Security Command Center][product-docs]. + +[Cloud Security Command Center](https://cloud.google.com/security-command-center/docs/) helps +security teams gather data, identify threats, and act on them before they result in business +damage or loss. It offers deep insight into application and data risk so that you can quickly +mitigate threats to your cloud resources and evaluate overall health. With Cloud Security +Command Center, you can view and monitor an inventory of your cloud assets, scan storage +systems for sensitive data, detect common web vulnerabilities, and review access rights +to your critical resources, all from a single, centralized dashboard. + +## 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-security-center#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-security-center/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-security-center&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node quickstart.js [organization]` + + + + + + +[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-security-center&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/security-command-center diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js new file mode 100644 index 00000000000..1f03f930fe1 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js @@ -0,0 +1,87 @@ +// 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 securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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, at which bulk action needs to be applied. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Expression that identifies findings that should be updated. + * The expression is a list of zero or more restrictions combined + * via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + * has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a + * `-` character in front of them to indicate negation. The fields map to + * those defined in the corresponding resource. + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + */ + // const filter = 'abc123' + /** + * This can be a mute configuration name or any identifier for mute/unmute + * of findings based on the filter. + */ + // const muteAnnotation = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callBulkMuteFindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await securitycenterClient.bulkMuteFindings(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBulkMuteFindings(); + // [END securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js new file mode 100644 index 00000000000..e87ad301e7e --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.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, bigQueryExport, bigQueryExportId) { + // [START securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new big query export's parent. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Required. The big query export being created. + */ + // const bigQueryExport = {} + /** + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of lower case letters, numbers, and hyphen, with the first + * character a letter, the last a letter or a number, and a 63 character + * maximum. + */ + // const bigQueryExportId = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateBigQueryExport() { + // Construct request + const request = { + parent, + bigQueryExport, + bigQueryExportId, + }; + + // Run request + const response = await securitycenterClient.createBigQueryExport(request); + console.log(response); + } + + callCreateBigQueryExport(); + // [END securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js new file mode 100644 index 00000000000..830510a7b21 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.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(parent, findingId, finding) { + // [START securitycenter_v1_generated_SecurityCenter_CreateFinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + */ + // const parent = 'abc123' + /** + * Required. Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + */ + // const findingId = 'abc123' + /** + * Required. The Finding being created. The name and security_marks will be + * ignored as they are both output only fields on this resource. + */ + // const finding = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateFinding() { + // Construct request + const request = { + parent, + findingId, + finding, + }; + + // Run request + const response = await securitycenterClient.createFinding(request); + console.log(response); + } + + callCreateFinding(); + // [END securitycenter_v1_generated_SecurityCenter_CreateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js new file mode 100644 index 00000000000..c122ec64a41 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.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, muteConfig, muteConfigId) { + // [START securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new mute configs's parent. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Required. The mute config being created. + */ + // const muteConfig = {} + /** + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of lower case letters, numbers, and hyphen, with the first + * character a letter, the last a letter or a number, and a 63 character + * maximum. + */ + // const muteConfigId = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateMuteConfig() { + // Construct request + const request = { + parent, + muteConfig, + muteConfigId, + }; + + // Run request + const response = await securitycenterClient.createMuteConfig(request); + console.log(response); + } + + callCreateMuteConfig(); + // [END securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js new file mode 100644 index 00000000000..18d45fca008 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js @@ -0,0 +1,78 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, configId, notificationConfig) { + // [START securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new notification config's parent. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Required. + * Unique identifier provided by the client within the parent scope. + * It must be between 1 and 128 characters, and contains alphanumeric + * characters, underscores or hyphens only. + */ + // const configId = 'abc123' + /** + * Required. The notification config being created. The name and the service + * account will be ignored as they are both output only fields on this + * resource. + */ + // const notificationConfig = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateNotificationConfig() { + // Construct request + const request = { + parent, + configId, + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.createNotificationConfig(request); + console.log(response); + } + + callCreateNotificationConfig(); + // [END securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js new file mode 100644 index 00000000000..4e41f9f4a6c --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.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(parent, source) { + // [START securitycenter_v1_generated_SecurityCenter_CreateSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * Required. The Source being created, only the display_name and description + * will be used. All other fields will be ignored. + */ + // const source = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateSource() { + // Construct request + const request = { + parent, + source, + }; + + // Run request + const response = await securitycenterClient.createSource(request); + console.log(response); + } + + callCreateSource(); + // [END securitycenter_v1_generated_SecurityCenter_CreateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js new file mode 100644 index 00000000000..1e94fcdd11e --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js @@ -0,0 +1,64 @@ +// 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 securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the big query export to delete. Its format is + * organizations/{organization}/bigQueryExports/{export_id}, + * folders/{folder}/bigQueryExports/{export_id}, or + * projects/{project}/bigQueryExports/{export_id} + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callDeleteBigQueryExport() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteBigQueryExport(request); + console.log(response); + } + + callDeleteBigQueryExport(); + // [END securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js new file mode 100644 index 00000000000..c4790e253f3 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js @@ -0,0 +1,64 @@ +// 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 securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the mute config to delete. Its format is + * organizations/{organization}/muteConfigs/{config_id}, + * folders/{folder}/muteConfigs/{config_id}, or + * projects/{project}/muteConfigs/{config_id} + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callDeleteMuteConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteMuteConfig(request); + console.log(response); + } + + callDeleteMuteConfig(); + // [END securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js new file mode 100644 index 00000000000..bc7dc2422be --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_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 securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the notification config to delete. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callDeleteNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteNotificationConfig(request); + console.log(response); + } + + callDeleteNotificationConfig(); + // [END securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js new file mode 100644 index 00000000000..0040054cd65 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js @@ -0,0 +1,64 @@ +// 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 securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the big query export to retrieve. Its format is + * organizations/{organization}/bigQueryExports/{export_id}, + * folders/{folder}/bigQueryExports/{export_id}, or + * projects/{project}/bigQueryExports/{export_id} + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetBigQueryExport() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getBigQueryExport(request); + console.log(response); + } + + callGetBigQueryExport(); + // [END securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js new file mode 100644 index 00000000000..2dae21363e4 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.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(resource) { + // [START securitycenter_v1_generated_SecurityCenter_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await securitycenterClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END securitycenter_v1_generated_SecurityCenter_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js new file mode 100644 index 00000000000..c7efec299ba --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js @@ -0,0 +1,64 @@ +// 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 securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the mute config to retrieve. Its format is + * organizations/{organization}/muteConfigs/{config_id}, + * folders/{folder}/muteConfigs/{config_id}, or + * projects/{project}/muteConfigs/{config_id} + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetMuteConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getMuteConfig(request); + console.log(response); + } + + callGetMuteConfig(); + // [END securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js new file mode 100644 index 00000000000..16b1cb7ca4b --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_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 securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the notification config to get. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getNotificationConfig(request); + console.log(response); + } + + callGetNotificationConfig(); + // [END securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js new file mode 100644 index 00000000000..aabb6b473e8 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.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 securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to get organization settings for. Its + * format is "organizations/[organization_id]/organizationSettings". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetOrganizationSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getOrganizationSettings(request); + console.log(response); + } + + callGetOrganizationSettings(); + // [END securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js new file mode 100644 index 00000000000..fbb1bbe0fa7 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.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 securitycenter_v1_generated_SecurityCenter_GetSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getSource(request); + console.log(response); + } + + callGetSource(); + // [END securitycenter_v1_generated_SecurityCenter_GetSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js new file mode 100644 index 00000000000..8f7c8de7912 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js @@ -0,0 +1,176 @@ +// 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, groupBy) { + // [START securitycenter_v1_generated_SecurityCenter_GroupAssets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following field and operator combinations are supported: + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * For example, `resource_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + */ + // const filter = 'abc123' + /** + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: + * "security_center_properties.resource_project,security_center_properties.project". + * The following fields are supported when compare_duration is not set: + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * The following fields are supported when compare_duration is set: + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + */ + // const groupBy = 'abc123' + /** + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * Possible "state_change" values when compare_duration is specified: + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * If this field is set then `state_change` must be a specified field in + * `group_by`. + */ + // const compareDuration = {} + /** + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + */ + // const readTime = {} + /** + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGroupAssets() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = await securitycenterClient.groupAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGroupAssets(); + // [END securitycenter_v1_generated_SecurityCenter_GroupAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js new file mode 100644 index 00000000000..86278e4aabf --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js @@ -0,0 +1,180 @@ +// 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, groupBy) { + // [START securitycenter_v1_generated_SecurityCenter_GroupFindings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following field and operator combinations are supported: + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * * severity: `=`, `:` + * * workflow_state: `=`, `:` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * For example, `source_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + */ + // const filter = 'abc123' + /** + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". + * The following fields are supported: + * * resource_name + * * category + * * state + * * parent + * * severity + * The following fields are supported when compare_duration is set: + * * state_change + */ + // const groupBy = 'abc123' + /** + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + */ + // const readTime = {} + /** + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * Possible "state_change" values when compare_duration is specified: + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * If this field is set then `state_change` must be a specified field in + * `group_by`. + */ + // const compareDuration = {} + /** + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGroupFindings() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = await securitycenterClient.groupFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGroupFindings(); + // [END securitycenter_v1_generated_SecurityCenter_GroupFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js new file mode 100644 index 00000000000..8544695560c --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js @@ -0,0 +1,185 @@ +// 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 securitycenter_v1_generated_SecurityCenter_ListAssets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following are the allowed field and operator combinations: + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * For example, `resource_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + */ + // const filter = 'abc123' + /** + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + */ + // const orderBy = 'abc123' + /** + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + */ + // const readTime = {} + /** + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * Possible "state_change" values when compare_duration is specified: + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + */ + // const compareDuration = {} + /** + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + */ + // const fieldMask = {} + /** + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAssets(); + // [END securitycenter_v1_generated_SecurityCenter_ListAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js new file mode 100644 index 00000000000..4489f1a9954 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js @@ -0,0 +1,79 @@ +// 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 securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListBigQueryExports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListBigQueryExports` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListBigQueryExports() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listBigQueryExportsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBigQueryExports(); + // [END securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js new file mode 100644 index 00000000000..24a1527f200 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js @@ -0,0 +1,191 @@ +// 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 securitycenter_v1_generated_SecurityCenter_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. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following field and operator combinations are supported: + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * * severity: `=`, `:` + * * workflow_state: `=`, `:` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * For example, `source_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + * * resource.folders.resource_folder: `=`, `:` + * * resource.display_name: `=`, `:` + */ + // const filter = 'abc123' + /** + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + */ + // const orderBy = 'abc123' + /** + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + */ + // const readTime = {} + /** + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * Possible "state_change" values when compare_duration is specified: + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + */ + // const compareDuration = {} + /** + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + */ + // const fieldMask = {} + /** + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListFindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFindings(); + // [END securitycenter_v1_generated_SecurityCenter_ListFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js new file mode 100644 index 00000000000..168ee39b535 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js @@ -0,0 +1,79 @@ +// 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 securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListMuteConfigs` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListMuteConfigs` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListMuteConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listMuteConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMuteConfigs(); + // [END securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js new file mode 100644 index 00000000000..b30022943ff --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_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 securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to list notification configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + */ + // const parent = 'abc123' + /** + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListNotificationConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listNotificationConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListNotificationConfigs(); + // [END securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js new file mode 100644 index 00000000000..12b6eb6b8e3 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.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 securitycenter_v1_generated_SecurityCenter_ListSources_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + */ + // const parent = 'abc123' + /** + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSources(); + // [END securitycenter_v1_generated_SecurityCenter_ListSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js new file mode 100644 index 00000000000..2c2af7fb3dd --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.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 securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to run asset discovery for. Its format + * is "organizations/[organization_id]". + */ + // const parent = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callRunAssetDiscovery() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await securitycenterClient.runAssetDiscovery(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunAssetDiscovery(); + // [END securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js new file mode 100644 index 00000000000..d2af87fcf92 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js @@ -0,0 +1,74 @@ +// 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, state, startTime) { + // [START securitycenter_v1_generated_SecurityCenter_SetFindingState_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}". + */ + // const name = 'abc123' + /** + * Required. The desired State of the finding. + */ + // const state = {} + /** + * Required. The time at which the updated state takes effect. + */ + // const startTime = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetFindingState() { + // Construct request + const request = { + name, + state, + startTime, + }; + + // Run request + const response = await securitycenterClient.setFindingState(request); + console.log(response); + } + + callSetFindingState(); + // [END securitycenter_v1_generated_SecurityCenter_SetFindingState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js new file mode 100644 index 00000000000..7ba3e484e67 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.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(resource, policy) { + // [START securitycenter_v1_generated_SecurityCenter_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await securitycenterClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END securitycenter_v1_generated_SecurityCenter_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js new file mode 100644 index 00000000000..617c0622993 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js @@ -0,0 +1,71 @@ +// 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, mute) { + // [START securitycenter_v1_generated_SecurityCenter_SetMute_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + * "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + * "projects/{project_id}/sources/{source_id}/findings/{finding_id}". + */ + // const name = 'abc123' + /** + * Required. The desired state of the Mute. + */ + // const mute = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetMute() { + // Construct request + const request = { + name, + mute, + }; + + // Run request + const response = await securitycenterClient.setMute(request); + console.log(response); + } + + callSetMute(); + // [END securitycenter_v1_generated_SecurityCenter_SetMute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js new file mode 100644 index 00000000000..5e0cf0b1194 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.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(resource, permissions) { + // [START securitycenter_v1_generated_SecurityCenter_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await securitycenterClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END securitycenter_v1_generated_SecurityCenter_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js new file mode 100644 index 00000000000..bbba7509ac0 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js @@ -0,0 +1,66 @@ +// 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(bigQueryExport) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The BigQuery export being updated. + */ + // const bigQueryExport = {} + /** + * The list of fields to be updated. + * If empty all mutable fields will be updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateBigQueryExport() { + // Construct request + const request = { + bigQueryExport, + }; + + // Run request + const response = await securitycenterClient.updateBigQueryExport(request); + console.log(response); + } + + callUpdateBigQueryExport(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js new file mode 100644 index 00000000000..4bfd209f470 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js @@ -0,0 +1,66 @@ +// 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(externalSystem) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The external system resource to update. + */ + // const externalSystem = {} + /** + * The FieldMask to use when updating the external system resource. + * If empty all mutable fields will be updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateExternalSystem() { + // Construct request + const request = { + externalSystem, + }; + + // Run request + const response = await securitycenterClient.updateExternalSystem(request); + console.log(response); + } + + callUpdateExternalSystem(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js new file mode 100644 index 00000000000..178749ea115 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js @@ -0,0 +1,74 @@ +// 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(finding) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateFinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The finding resource to update or create if it does not already + * exist. parent, security_marks, and update_time will be ignored. + * In the case of creation, the finding id portion of the name must be + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + */ + // const finding = {} + /** + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * When updating a finding, an empty mask is treated as updating all mutable + * fields and replacing source_properties. Individual source_properties can + * be added/updated by using "source_properties." in the field + * mask. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateFinding() { + // Construct request + const request = { + finding, + }; + + // Run request + const response = await securitycenterClient.updateFinding(request); + console.log(response); + } + + callUpdateFinding(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js new file mode 100644 index 00000000000..2740ec72d0f --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js @@ -0,0 +1,66 @@ +// 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(muteConfig) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The mute config being updated. + */ + // const muteConfig = {} + /** + * The list of fields to be updated. + * If empty all mutable fields will be updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateMuteConfig() { + // Construct request + const request = { + muteConfig, + }; + + // Run request + const response = await securitycenterClient.updateMuteConfig(request); + console.log(response); + } + + callUpdateMuteConfig(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js new file mode 100644 index 00000000000..cfc925dea80 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js @@ -0,0 +1,66 @@ +// 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(notificationConfig) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The notification config to update. + */ + // const notificationConfig = {} + /** + * The FieldMask to use when updating the notification config. + * If empty all mutable fields will be updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateNotificationConfig() { + // Construct request + const request = { + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.updateNotificationConfig(request); + console.log(response); + } + + callUpdateNotificationConfig(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js new file mode 100644 index 00000000000..733ed3a0c3c --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js @@ -0,0 +1,66 @@ +// 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(organizationSettings) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The organization settings resource to update. + */ + // const organizationSettings = {} + /** + * The FieldMask to use when updating the settings resource. + * If empty all mutable fields will be updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateOrganizationSettings() { + // Construct request + const request = { + organizationSettings, + }; + + // Run request + const response = await securitycenterClient.updateOrganizationSettings(request); + console.log(response); + } + + callUpdateOrganizationSettings(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js new file mode 100644 index 00000000000..afaec0ff165 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.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(securityMarks) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The security marks resource to update. + */ + // const securityMarks = {} + /** + * The FieldMask to use when updating the security marks resource. + * The field mask must not contain duplicate fields. + * If empty or set to "marks", all marks will be replaced. Individual + * marks can be updated using "marks.". + */ + // const updateMask = {} + /** + * The time at which the updated SecurityMarks take effect. + * If not set uses current server time. Updates will be applied to the + * SecurityMarks that are active immediately preceding this time. Must be + * earlier or equal to the server time. + */ + // const startTime = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateSecurityMarks() { + // Construct request + const request = { + securityMarks, + }; + + // Run request + const response = await securitycenterClient.updateSecurityMarks(request); + console.log(response); + } + + callUpdateSecurityMarks(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js new file mode 100644 index 00000000000..44a4da05584 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js @@ -0,0 +1,66 @@ +// 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(source) { + // [START securitycenter_v1_generated_SecurityCenter_UpdateSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The source resource to update. + */ + // const source = {} + /** + * The FieldMask to use when updating the source resource. + * If empty all mutable fields will be updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateSource() { + // Construct request + const request = { + source, + }; + + // Run request + const response = await securitycenterClient.updateSource(request); + console.log(response); + } + + callUpdateSource(); + // [END securitycenter_v1_generated_SecurityCenter_UpdateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json new file mode 100644 index 00000000000..3a94855f5e2 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -0,0 +1,1699 @@ +{ + "clientLibrary": { + "name": "nodejs-securitycenter", + "version": "7.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.securitycenter.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async", + "title": "SecurityCenter bulkMuteFindings Sample", + "origin": "API_DEFINITION", + "description": " Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.", + "canonical": true, + "file": "security_center.bulk_mute_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BulkMuteFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "mute_annotation", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "BulkMuteFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateSource_async", + "title": "SecurityCenter createSource Sample", + "origin": "API_DEFINITION", + "description": " Creates a source.", + "canonical": true, + "file": "security_center.create_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateSource", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.securitycenter.v1.Source" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateFinding_async", + "title": "SecurityCenter createFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates a finding. The corresponding source must exist for finding creation to succeed.", + "canonical": true, + "file": "security_center.create_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateFinding", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "finding_id", + "type": "TYPE_STRING" + }, + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1.Finding" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async", + "title": "SecurityCenter createMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a mute config.", + "canonical": true, + "file": "security_center.create_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "mute_config", + "type": ".google.cloud.securitycenter.v1.MuteConfig" + }, + { + "name": "mute_config_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.MuteConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_async", + "title": "SecurityCenter createNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a notification config.", + "canonical": true, + "file": "security_center.create_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "config_id", + "type": "TYPE_STRING" + }, + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v1.NotificationConfig" + } + ], + "resultType": ".google.cloud.securitycenter.v1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async", + "title": "SecurityCenter deleteMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing mute config.", + "canonical": true, + "file": "security_center.delete_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_async", + "title": "SecurityCenter deleteNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a notification config.", + "canonical": true, + "file": "security_center.delete_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_async", + "title": "SecurityCenter getBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Gets a big query export.", + "canonical": true, + "file": "security_center.get_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.BigQueryExport", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetIamPolicy_async", + "title": "SecurityCenter getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async", + "title": "SecurityCenter getMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a mute config.", + "canonical": true, + "file": "security_center.get_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.MuteConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_async", + "title": "SecurityCenter getNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a notification config.", + "canonical": true, + "file": "security_center.get_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_async", + "title": "SecurityCenter getOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Gets the settings for an organization.", + "canonical": true, + "file": "security_center.get_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GetSource_async", + "title": "SecurityCenter getSource Sample", + "origin": "API_DEFINITION", + "description": " Gets a source.", + "canonical": true, + "file": "security_center.get_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GetSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GroupAssets_async", + "title": "SecurityCenter groupAssets Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization's assets and groups them by their specified properties.", + "canonical": true, + "file": "security_center.group_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 168, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.GroupAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_GroupFindings_async", + "title": "SecurityCenter groupFindings Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", + "canonical": true, + "file": "security_center.group_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 172, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.GroupFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.GroupFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListAssets_async", + "title": "SecurityCenter listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization's assets.", + "canonical": true, + "file": "security_center.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 177, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListFindings_async", + "title": "SecurityCenter listFindings Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings", + "canonical": true, + "file": "security_center.list_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 183, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async", + "title": "SecurityCenter listMuteConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists mute configs.", + "canonical": true, + "file": "security_center.list_mute_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMuteConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListMuteConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListMuteConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_async", + "title": "SecurityCenter listNotificationConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists notification configs.", + "canonical": true, + "file": "security_center.list_notification_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListNotificationConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListSources_async", + "title": "SecurityCenter listSources Sample", + "origin": "API_DEFINITION", + "description": " Lists all sources belonging to an organization.", + "canonical": true, + "file": "security_center.list_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListSourcesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListSources", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async", + "title": "SecurityCenter runAssetDiscovery Sample", + "origin": "API_DEFINITION", + "description": " Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", + "canonical": true, + "file": "security_center.run_asset_discovery.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscovery", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscovery", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_SetFindingState_async", + "title": "SecurityCenter setFindingState Sample", + "origin": "API_DEFINITION", + "description": " Updates the state of a finding.", + "canonical": true, + "file": "security_center.set_finding_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetFindingState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "state", + "type": ".google.cloud.securitycenter.v1.Finding.State" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetFindingState", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_SetMute_async", + "title": "SecurityCenter setMute Sample", + "origin": "API_DEFINITION", + "description": " Updates the mute state of a finding.", + "canonical": true, + "file": "security_center.set_mute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetMute", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetMute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "mute", + "type": ".google.cloud.securitycenter.v1.Finding.Mute" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "SetMute", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetMute", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_SetIamPolicy_async", + "title": "SecurityCenter setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_TestIamPermissions_async", + "title": "SecurityCenter testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns the permissions that a caller has on the specified source.", + "canonical": true, + "file": "security_center.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissions", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_async", + "title": "SecurityCenter updateExternalSystem Sample", + "origin": "API_DEFINITION", + "description": " Updates external system. This is for a given finding.", + "canonical": true, + "file": "security_center.update_external_system.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateExternalSystem", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystem", + "async": true, + "parameters": [ + { + "name": "external_system", + "type": ".google.cloud.securitycenter.v1.ExternalSystem" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ExternalSystem", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateExternalSystem", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystem", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateFinding_async", + "title": "SecurityCenter updateFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", + "canonical": true, + "file": "security_center.update_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateFinding", + "async": true, + "parameters": [ + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1.Finding" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async", + "title": "SecurityCenter updateMuteConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a mute config.", + "canonical": true, + "file": "security_center.update_mute_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfig", + "async": true, + "parameters": [ + { + "name": "mute_config", + "type": ".google.cloud.securitycenter.v1.MuteConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.MuteConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateMuteConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_async", + "title": "SecurityCenter updateNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + "canonical": true, + "file": "security_center.update_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v1.NotificationConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_async", + "title": "SecurityCenter updateOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates an organization's settings.", + "canonical": true, + "file": "security_center.update_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "organization_settings", + "type": ".google.cloud.securitycenter.v1.OrganizationSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateSource_async", + "title": "SecurityCenter updateSource Sample", + "origin": "API_DEFINITION", + "description": " Updates a source.", + "canonical": true, + "file": "security_center.update_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSource", + "async": true, + "parameters": [ + { + "name": "source", + "type": ".google.cloud.securitycenter.v1.Source" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async", + "title": "SecurityCenter updateSecurityMarks Sample", + "origin": "API_DEFINITION", + "description": " Updates security marks.", + "canonical": true, + "file": "security_center.update_security_marks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarks", + "async": true, + "parameters": [ + { + "name": "security_marks", + "type": ".google.cloud.securitycenter.v1.SecurityMarks" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1.SecurityMarks", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarks", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_async", + "title": "SecurityCenter createBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Creates a big query export.", + "canonical": true, + "file": "security_center.create_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExport", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "big_query_export", + "type": ".google.cloud.securitycenter.v1.BigQueryExport" + }, + { + "name": "big_query_export_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.BigQueryExport", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_async", + "title": "SecurityCenter deleteBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing big query export.", + "canonical": true, + "file": "security_center.delete_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_async", + "title": "SecurityCenter updateBigQueryExport Sample", + "origin": "API_DEFINITION", + "description": " Updates a BigQuery export.", + "canonical": true, + "file": "security_center.update_big_query_export.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExport", + "async": true, + "parameters": [ + { + "name": "big_query_export", + "type": ".google.cloud.securitycenter.v1.BigQueryExport" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1.BigQueryExport", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateBigQueryExport", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExport", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_async", + "title": "SecurityCenter listBigQueryExports Sample", + "origin": "API_DEFINITION", + "description": " Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.", + "canonical": true, + "file": "security_center.list_big_query_exports.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBigQueryExports", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExports", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1.ListBigQueryExportsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1.SecurityCenterClient" + }, + "method": { + "shortName": "ListBigQueryExports", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExports", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js new file mode 100644 index 00000000000..84d8f61e5aa --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.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(parent, findingId, finding) { + // [START securitycenter_v1beta1_generated_SecurityCenter_CreateFinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + */ + // const parent = 'abc123' + /** + * Required. Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + */ + // const findingId = 'abc123' + /** + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + */ + // const finding = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateFinding() { + // Construct request + const request = { + parent, + findingId, + finding, + }; + + // Run request + const response = await securitycenterClient.createFinding(request); + console.log(response); + } + + callCreateFinding(); + // [END securitycenter_v1beta1_generated_SecurityCenter_CreateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js new file mode 100644 index 00000000000..7acc3965f9a --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.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(parent, source) { + // [START securitycenter_v1beta1_generated_SecurityCenter_CreateSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + */ + // const source = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateSource() { + // Construct request + const request = { + parent, + source, + }; + + // Run request + const response = await securitycenterClient.createSource(request); + console.log(response); + } + + callCreateSource(); + // [END securitycenter_v1beta1_generated_SecurityCenter_CreateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js new file mode 100644 index 00000000000..d3ca93d7f8d --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.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(resource) { + // [START securitycenter_v1beta1_generated_SecurityCenter_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await securitycenterClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END securitycenter_v1beta1_generated_SecurityCenter_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js new file mode 100644 index 00000000000..acfb907c536 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.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 securitycenter_v1beta1_generated_SecurityCenter_GetOrganizationSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetOrganizationSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getOrganizationSettings(request); + console.log(response); + } + + callGetOrganizationSettings(); + // [END securitycenter_v1beta1_generated_SecurityCenter_GetOrganizationSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js new file mode 100644 index 00000000000..abd111d2520 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.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 securitycenter_v1beta1_generated_SecurityCenter_GetSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getSource(request); + console.log(response); + } + + callGetSource(); + // [END securitycenter_v1beta1_generated_SecurityCenter_GetSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js new file mode 100644 index 00000000000..fd7038cd417 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js @@ -0,0 +1,139 @@ +// 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, groupBy) { + // [START securitycenter_v1beta1_generated_SecurityCenter_GroupAssets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * For example, `resource_properties.size = 100` is a valid filter string. + */ + // const filter = 'abc123' + /** + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * The following fields are supported when compare_duration is not set: + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * The following fields are supported when compare_duration is set: + * * security_center_properties.resource_type + */ + // const groupBy = 'abc123' + /** + * When compare_duration is set, the Asset's "state" property is updated to + * indicate whether the asset was added, removed, or remained present during + * the compare_duration period of time that precedes the read_time. This is + * the time between (read_time - compare_duration) and read_time. + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * Possible "state" values when compare_duration is specified: + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * This field is ignored if `state` is not a field in `group_by`. + */ + // const compareDuration = {} + /** + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + */ + // const readTime = {} + /** + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGroupAssets() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = await securitycenterClient.groupAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGroupAssets(); + // [END securitycenter_v1beta1_generated_SecurityCenter_GroupAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js new file mode 100644 index 00000000000..4edc72f898d --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js @@ -0,0 +1,118 @@ +// 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, groupBy) { + // [START securitycenter_v1beta1_generated_SecurityCenter_GroupFindings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * For example, `source_properties.size = 100` is a valid filter string. + */ + // const filter = 'abc123' + /** + * Required. Expression that defines what assets fields to use for grouping (including + * `state`). The string value should follow SQL syntax: comma separated list + * of fields. For example: + * "parent,resource_name". + * The following fields are supported: + * * resource_name + * * category + * * state + * * parent + */ + // const groupBy = 'abc123' + /** + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + */ + // const readTime = {} + /** + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGroupFindings() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = await securitycenterClient.groupFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGroupFindings(); + // [END securitycenter_v1beta1_generated_SecurityCenter_GroupFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js new file mode 100644 index 00000000000..0dd5ef9e40e --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js @@ -0,0 +1,144 @@ +// 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 securitycenter_v1beta1_generated_SecurityCenter_ListAssets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * For example, `resource_properties.size = 100` is a valid filter string. + */ + // const filter = 'abc123' + /** + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + */ + // const orderBy = 'abc123' + /** + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + */ + // const readTime = {} + /** + * When compare_duration is set, the ListAssetResult's "state" attribute is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - + * compare_duration) and read_time. + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * Possible "state" values when compare_duration is specified: + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * If compare_duration is not specified, then the only possible state is + * "UNUSED", which indicates that the asset is present at read_time. + */ + // const compareDuration = {} + /** + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + */ + // const fieldMask = {} + /** + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAssets(); + // [END securitycenter_v1beta1_generated_SecurityCenter_ListAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js new file mode 100644 index 00000000000..9240789a680 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js @@ -0,0 +1,121 @@ +// 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 securitycenter_v1beta1_generated_SecurityCenter_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. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * For example, `source_properties.size = 100` is a valid filter string. + */ + // const filter = 'abc123' + /** + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + */ + // const orderBy = 'abc123' + /** + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + */ + // const readTime = {} + /** + * Optional. A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + */ + // const fieldMask = {} + /** + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListFindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFindings(); + // [END securitycenter_v1beta1_generated_SecurityCenter_ListFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js new file mode 100644 index 00000000000..af32bd04ad3 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.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(parent) { + // [START securitycenter_v1beta1_generated_SecurityCenter_ListSources_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSources(); + // [END securitycenter_v1beta1_generated_SecurityCenter_ListSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js new file mode 100644 index 00000000000..4a8fd60bd90 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.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 securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callRunAssetDiscovery() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await securitycenterClient.runAssetDiscovery(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunAssetDiscovery(); + // [END securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js new file mode 100644 index 00000000000..2a4fc5d924b --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js @@ -0,0 +1,74 @@ +// 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, state, startTime) { + // [START securitycenter_v1beta1_generated_SecurityCenter_SetFindingState_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + */ + // const name = 'abc123' + /** + * Required. The desired State of the finding. + */ + // const state = {} + /** + * Required. The time at which the updated state takes effect. + */ + // const startTime = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetFindingState() { + // Construct request + const request = { + name, + state, + startTime, + }; + + // Run request + const response = await securitycenterClient.setFindingState(request); + console.log(response); + } + + callSetFindingState(); + // [END securitycenter_v1beta1_generated_SecurityCenter_SetFindingState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js new file mode 100644 index 00000000000..00855ffd8ac --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.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(resource, policy) { + // [START securitycenter_v1beta1_generated_SecurityCenter_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await securitycenterClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END securitycenter_v1beta1_generated_SecurityCenter_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js new file mode 100644 index 00000000000..549330173f1 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.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(resource, permissions) { + // [START securitycenter_v1beta1_generated_SecurityCenter_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await securitycenterClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END securitycenter_v1beta1_generated_SecurityCenter_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js new file mode 100644 index 00000000000..befaed349d3 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.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(finding) { + // [START securitycenter_v1beta1_generated_SecurityCenter_UpdateFinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * In the case of creation, the finding id portion of the name must + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + */ + // const finding = {} + /** + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateFinding() { + // Construct request + const request = { + finding, + }; + + // Run request + const response = await securitycenterClient.updateFinding(request); + console.log(response); + } + + callUpdateFinding(); + // [END securitycenter_v1beta1_generated_SecurityCenter_UpdateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js new file mode 100644 index 00000000000..454e30ca0af --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.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(organizationSettings) { + // [START securitycenter_v1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The organization settings resource to update. + */ + // const organizationSettings = {} + /** + * The FieldMask to use when updating the settings resource. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateOrganizationSettings() { + // Construct request + const request = { + organizationSettings, + }; + + // Run request + const response = await securitycenterClient.updateOrganizationSettings(request); + console.log(response); + } + + callUpdateOrganizationSettings(); + // [END securitycenter_v1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js new file mode 100644 index 00000000000..8735efc1a42 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js @@ -0,0 +1,69 @@ +// 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(securityMarks) { + // [START securitycenter_v1beta1_generated_SecurityCenter_UpdateSecurityMarks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The security marks resource to update. + */ + // const securityMarks = {} + /** + * The FieldMask to use when updating the security marks resource. + */ + // const updateMask = {} + /** + * The time at which the updated SecurityMarks take effect. + */ + // const startTime = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateSecurityMarks() { + // Construct request + const request = { + securityMarks, + }; + + // Run request + const response = await securitycenterClient.updateSecurityMarks(request); + console.log(response); + } + + callUpdateSecurityMarks(); + // [END securitycenter_v1beta1_generated_SecurityCenter_UpdateSecurityMarks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js new file mode 100644 index 00000000000..aef8890432c --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.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(source) { + // [START securitycenter_v1beta1_generated_SecurityCenter_UpdateSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The source resource to update. + */ + // const source = {} + /** + * The FieldMask to use when updating the source resource. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateSource() { + // Construct request + const request = { + source, + }; + + // Run request + const response = await securitycenterClient.updateSource(request); + console.log(response); + } + + callUpdateSource(); + // [END securitycenter_v1beta1_generated_SecurityCenter_UpdateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json new file mode 100644 index 00000000000..31a9da2ef63 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -0,0 +1,895 @@ +{ + "clientLibrary": { + "name": "nodejs-securitycenter", + "version": "7.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.securitycenter.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_CreateSource_async", + "title": "SecurityCenter createSource Sample", + "origin": "API_DEFINITION", + "description": " Creates a source.", + "canonical": true, + "file": "security_center.create_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSource", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.securitycenter.v1beta1.Source" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_CreateFinding_async", + "title": "SecurityCenter createFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates a finding. The corresponding source must exist for finding creation to succeed.", + "canonical": true, + "file": "security_center.create_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFinding", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "finding_id", + "type": "TYPE_STRING" + }, + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1beta1.Finding" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.CreateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GetIamPolicy_async", + "title": "SecurityCenter getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GetOrganizationSettings_async", + "title": "SecurityCenter getOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Gets the settings for an organization.", + "canonical": true, + "file": "security_center.get_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GetSource_async", + "title": "SecurityCenter getSource Sample", + "origin": "API_DEFINITION", + "description": " Gets a source.", + "canonical": true, + "file": "security_center.get_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GetSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GroupAssets_async", + "title": "SecurityCenter groupAssets Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization's assets and groups them by their specified properties.", + "canonical": true, + "file": "security_center.group_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 131, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.GroupAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_GroupFindings_async", + "title": "SecurityCenter groupFindings Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1beta1/organizations/{organization_id}/sources/-/findings", + "canonical": true, + "file": "security_center.group_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 110, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.GroupFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.GroupFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_ListAssets_async", + "title": "SecurityCenter listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization's assets.", + "canonical": true, + "file": "security_center.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 136, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.ListAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_ListFindings_async", + "title": "SecurityCenter listFindings Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1beta1/organizations/{organization_id}/sources/-/findings", + "canonical": true, + "file": "security_center.list_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 113, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.ListFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_ListSources_async", + "title": "SecurityCenter listSources Sample", + "origin": "API_DEFINITION", + "description": " Lists all sources belonging to an organization.", + "canonical": true, + "file": "security_center.list_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.ListSourcesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.ListSources", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async", + "title": "SecurityCenter runAssetDiscovery Sample", + "origin": "API_DEFINITION", + "description": " Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", + "canonical": true, + "file": "security_center.run_asset_discovery.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscovery", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.RunAssetDiscovery", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_SetFindingState_async", + "title": "SecurityCenter setFindingState Sample", + "origin": "API_DEFINITION", + "description": " Updates the state of a finding.", + "canonical": true, + "file": "security_center.set_finding_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "state", + "type": ".google.cloud.securitycenter.v1beta1.Finding.State" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetFindingState", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_SetIamPolicy_async", + "title": "SecurityCenter setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.SetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_TestIamPermissions_async", + "title": "SecurityCenter testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns the permissions that a caller has on the specified source.", + "canonical": true, + "file": "security_center.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.TestIamPermissions", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateFinding_async", + "title": "SecurityCenter updateFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", + "canonical": true, + "file": "security_center.update_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFinding", + "async": true, + "parameters": [ + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1beta1.Finding" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async", + "title": "SecurityCenter updateOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates an organization's settings.", + "canonical": true, + "file": "security_center.update_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "organization_settings", + "type": ".google.cloud.securitycenter.v1beta1.OrganizationSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateSource_async", + "title": "SecurityCenter updateSource Sample", + "origin": "API_DEFINITION", + "description": " Updates a source.", + "canonical": true, + "file": "security_center.update_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSource", + "async": true, + "parameters": [ + { + "name": "source", + "type": ".google.cloud.securitycenter.v1beta1.Source" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1beta1_generated_SecurityCenter_UpdateSecurityMarks_async", + "title": "SecurityCenter updateSecurityMarks Sample", + "origin": "API_DEFINITION", + "description": " Updates security marks.", + "canonical": true, + "file": "security_center.update_security_marks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarks", + "async": true, + "parameters": [ + { + "name": "security_marks", + "type": ".google.cloud.securitycenter.v1beta1.SecurityMarks" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1beta1.SecurityMarks", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter.UpdateSecurityMarks", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1beta1.SecurityCenter" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js new file mode 100644 index 00000000000..f46bf1349cb --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js @@ -0,0 +1,73 @@ +// 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, findingId, finding) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + */ + // const parent = 'abc123' + /** + * Required. Unique identifier provided by the client within the parent scope. + */ + // const findingId = 'abc123' + /** + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + */ + // const finding = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateFinding() { + // Construct request + const request = { + parent, + findingId, + finding, + }; + + // Run request + const response = await securitycenterClient.createFinding(request); + console.log(response); + } + + callCreateFinding(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js new file mode 100644 index 00000000000..1748a6c04cb --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.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(parent, configId, notificationConfig) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new notification config's parent. Its format is + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * Required. Unique identifier provided by the client within the parent scope. + * It must be between 1 and 128 characters, and contains alphanumeric + * characters, underscores or hyphens only. + */ + // const configId = 'abc123' + /** + * Required. The notification config being created. The name and the service account + * will be ignored as they are both output only fields on this resource. + */ + // const notificationConfig = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateNotificationConfig() { + // Construct request + const request = { + parent, + configId, + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.createNotificationConfig(request); + console.log(response); + } + + callCreateNotificationConfig(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js new file mode 100644 index 00000000000..0c859d2ead2 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.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(parent, source) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + */ + // const source = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callCreateSource() { + // Construct request + const request = { + parent, + source, + }; + + // Run request + const response = await securitycenterClient.createSource(request); + console.log(response); + } + + callCreateSource(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js new file mode 100644 index 00000000000..6ab5fca8c7d --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_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 securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the notification config to delete. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callDeleteNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.deleteNotificationConfig(request); + console.log(response); + } + + callDeleteNotificationConfig(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js new file mode 100644 index 00000000000..e28fb517d91 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.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(resource) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await securitycenterClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js new file mode 100644 index 00000000000..a1a4b42ab73 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_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 securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the notification config to get. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetNotificationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getNotificationConfig(request); + console.log(response); + } + + callGetNotificationConfig(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js new file mode 100644 index 00000000000..1e469ca60f0 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.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 securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetOrganizationSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getOrganizationSettings(request); + console.log(response); + } + + callGetOrganizationSettings(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js new file mode 100644 index 00000000000..e147769f4c6 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.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 securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + */ + // const name = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGetSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await securitycenterClient.getSource(request); + console.log(response); + } + + callGetSource(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js new file mode 100644 index 00000000000..cb6b863604a --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js @@ -0,0 +1,176 @@ +// 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, groupBy) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following field and operator combinations are supported: + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_name_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * For example, `resource_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + */ + // const filter = 'abc123' + /** + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * The following fields are supported when compare_duration is not set: + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * The following fields are supported when compare_duration is set: + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + */ + // const groupBy = 'abc123' + /** + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * Possible "state_change" values when compare_duration is specified: + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * If this field is set then `state_change` must be a specified field in + * `group_by`. + */ + // const compareDuration = {} + /** + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + */ + // const readTime = {} + /** + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGroupAssets() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = await securitycenterClient.groupAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGroupAssets(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js new file mode 100644 index 00000000000..de78580a568 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js @@ -0,0 +1,172 @@ +// 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, groupBy) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following field and operator combinations are supported: + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * For example, `source_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + */ + // const filter = 'abc123' + /** + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". + * The following fields are supported: + * * resource_name + * * category + * * state + * * parent + * * severity + * The following fields are supported when compare_duration is set: + * * state_change + */ + // const groupBy = 'abc123' + /** + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + */ + // const readTime = {} + /** + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * Possible "state_change" values when compare_duration is specified: + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * If this field is set then `state_change` must be a specified field in + * `group_by`. + */ + // const compareDuration = {} + /** + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callGroupFindings() { + // Construct request + const request = { + parent, + groupBy, + }; + + // Run request + const iterable = await securitycenterClient.groupFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGroupFindings(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js new file mode 100644 index 00000000000..b98b82597d3 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js @@ -0,0 +1,185 @@ +// 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 securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following are the allowed field and operator combinations: + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * For example, `resource_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + */ + // const filter = 'abc123' + /** + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + */ + // const orderBy = 'abc123' + /** + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + */ + // const readTime = {} + /** + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * Possible "state_change" values when compare_duration is specified: + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + */ + // const compareDuration = {} + /** + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + */ + // const fieldMask = {} + /** + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAssets(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js new file mode 100644 index 00000000000..27e800be535 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js @@ -0,0 +1,181 @@ +// 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 securitycenter_v1p1beta1_generated_SecurityCenter_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. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- + */ + // const parent = 'abc123' + /** + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * The supported operators are: + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * The supported value types are: + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * The following field and operator combinations are supported: + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * security_marks.marks: `=`, `:` + * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * For example, `source_properties.size = 100` is a valid filter string. + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + */ + // const filter = 'abc123' + /** + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + */ + // const orderBy = 'abc123' + /** + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + */ + // const readTime = {} + /** + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * Possible "state_change" values when compare_duration is specified: + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + */ + // const compareDuration = {} + /** + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + */ + // const fieldMask = {} + /** + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListFindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFindings(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js new file mode 100644 index 00000000000..c1c1c471557 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_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(parent) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + */ + // const parent = 'abc123' + /** + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListNotificationConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listNotificationConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListNotificationConfigs(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js new file mode 100644 index 00000000000..6544f637a5c --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.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 securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + */ + // const parent = 'abc123' + /** + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + */ + // const pageSize = 1234 + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callListSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await securitycenterClient.listSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSources(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js new file mode 100644 index 00000000000..deae4cc152f --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.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 securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + */ + // const parent = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callRunAssetDiscovery() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await securitycenterClient.runAssetDiscovery(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunAssetDiscovery(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js new file mode 100644 index 00000000000..2cc7f1e6d4f --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js @@ -0,0 +1,74 @@ +// 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, state, startTime) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + */ + // const name = 'abc123' + /** + * Required. The desired State of the finding. + */ + // const state = {} + /** + * Required. The time at which the updated state takes effect. + */ + // const startTime = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetFindingState() { + // Construct request + const request = { + name, + state, + startTime, + }; + + // Run request + const response = await securitycenterClient.setFindingState(request); + console.log(response); + } + + callSetFindingState(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js new file mode 100644 index 00000000000..9ed2170ef5b --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.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(resource, policy) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await securitycenterClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js new file mode 100644 index 00000000000..944534ded96 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.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(resource, permissions) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await securitycenterClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js new file mode 100644 index 00000000000..8e8df6e373f --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js @@ -0,0 +1,74 @@ +// 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(finding) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * In the case of creation, the finding id portion of the name must be + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + */ + // const finding = {} + /** + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * When updating a finding, an empty mask is treated as updating all mutable + * fields and replacing source_properties. Individual source_properties can + * be added/updated by using "source_properties." in the field + * mask. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateFinding() { + // Construct request + const request = { + finding, + }; + + // Run request + const response = await securitycenterClient.updateFinding(request); + console.log(response); + } + + callUpdateFinding(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js new file mode 100644 index 00000000000..190a4de9b86 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js @@ -0,0 +1,66 @@ +// 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(notificationConfig) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The notification config to update. + */ + // const notificationConfig = {} + /** + * The FieldMask to use when updating the notification config. + * If empty all mutable fields will be updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateNotificationConfig() { + // Construct request + const request = { + notificationConfig, + }; + + // Run request + const response = await securitycenterClient.updateNotificationConfig(request); + console.log(response); + } + + callUpdateNotificationConfig(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js new file mode 100644 index 00000000000..ae5874ec435 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js @@ -0,0 +1,66 @@ +// 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(organizationSettings) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The organization settings resource to update. + */ + // const organizationSettings = {} + /** + * The FieldMask to use when updating the settings resource. + * If empty all mutable fields will be updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateOrganizationSettings() { + // Construct request + const request = { + organizationSettings, + }; + + // Run request + const response = await securitycenterClient.updateOrganizationSettings(request); + console.log(response); + } + + callUpdateOrganizationSettings(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js new file mode 100644 index 00000000000..f37b9529739 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js @@ -0,0 +1,74 @@ +// 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(securityMarks) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The security marks resource to update. + */ + // const securityMarks = {} + /** + * The FieldMask to use when updating the security marks resource. + * The field mask must not contain duplicate fields. + * If empty or set to "marks", all marks will be replaced. Individual + * marks can be updated using "marks.". + */ + // const updateMask = {} + /** + * The time at which the updated SecurityMarks take effect. + * If not set uses current server time. Updates will be applied to the + * SecurityMarks that are active immediately preceding this time. + */ + // const startTime = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateSecurityMarks() { + // Construct request + const request = { + securityMarks, + }; + + // Run request + const response = await securitycenterClient.updateSecurityMarks(request); + console.log(response); + } + + callUpdateSecurityMarks(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js new file mode 100644 index 00000000000..6c72c7b9177 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js @@ -0,0 +1,66 @@ +// 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(source) { + // [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The source resource to update. + */ + // const source = {} + /** + * The FieldMask to use when updating the source resource. + * If empty all mutable fields will be updated. + */ + // const updateMask = {} + + // Imports the Securitycenter library + const {SecurityCenterClient} = require('@google-cloud/security-center').v1p1beta1; + + // Instantiates a client + const securitycenterClient = new SecurityCenterClient(); + + async function callUpdateSource() { + // Construct request + const request = { + source, + }; + + // Run request + const response = await securitycenterClient.updateSource(request); + console.log(response); + } + + callUpdateSource(); + // [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json new file mode 100644 index 00000000000..c636c5c8e57 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -0,0 +1,1123 @@ +{ + "clientLibrary": { + "name": "nodejs-securitycenter", + "version": "7.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.securitycenter.v1p1beta1", + "version": "v1p1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_async", + "title": "SecurityCenter createSource Sample", + "origin": "API_DEFINITION", + "description": " Creates a source.", + "canonical": true, + "file": "security_center.create_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSource", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.securitycenter.v1p1beta1.Source" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_async", + "title": "SecurityCenter createFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates a finding. The corresponding source must exist for finding creation to succeed.", + "canonical": true, + "file": "security_center.create_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFinding", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "finding_id", + "type": "TYPE_STRING" + }, + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1p1beta1.Finding" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateFinding", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_async", + "title": "SecurityCenter createNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a notification config.", + "canonical": true, + "file": "security_center.create_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "config_id", + "type": "TYPE_STRING" + }, + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "CreateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_async", + "title": "SecurityCenter deleteNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a notification config.", + "canonical": true, + "file": "security_center.delete_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "DeleteNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_async", + "title": "SecurityCenter getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_async", + "title": "SecurityCenter getNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a notification config.", + "canonical": true, + "file": "security_center.get_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_async", + "title": "SecurityCenter getOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Gets the settings for an organization.", + "canonical": true, + "file": "security_center.get_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_async", + "title": "SecurityCenter getSource Sample", + "origin": "API_DEFINITION", + "description": " Gets a source.", + "canonical": true, + "file": "security_center.get_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GetSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_async", + "title": "SecurityCenter groupAssets Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization's assets and groups them by their specified properties.", + "canonical": true, + "file": "security_center.group_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 168, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupAssets", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_async", + "title": "SecurityCenter groupFindings Sample", + "origin": "API_DEFINITION", + "description": " Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings", + "canonical": true, + "file": "security_center.group_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 164, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "group_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "GroupFindings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_async", + "title": "SecurityCenter listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization's assets.", + "canonical": true, + "file": "security_center.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 177, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.ListAssetsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssets", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_async", + "title": "SecurityCenter listFindings Sample", + "origin": "API_DEFINITION", + "description": " Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings", + "canonical": true, + "file": "security_center.list_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 173, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compare_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.ListFindingsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListFindings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_async", + "title": "SecurityCenter listNotificationConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists notification configs.", + "canonical": true, + "file": "security_center.list_notification_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListNotificationConfigs", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigs", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_async", + "title": "SecurityCenter listSources Sample", + "origin": "API_DEFINITION", + "description": " Lists all sources belonging to an organization.", + "canonical": true, + "file": "security_center.list_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.ListSourcesResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "ListSources", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSources", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async", + "title": "SecurityCenter runAssetDiscovery Sample", + "origin": "API_DEFINITION", + "description": " Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.", + "canonical": true, + "file": "security_center.run_asset_discovery.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscovery", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "RunAssetDiscovery", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscovery", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_async", + "title": "SecurityCenter setFindingState Sample", + "origin": "API_DEFINITION", + "description": " Updates the state of a finding.", + "canonical": true, + "file": "security_center.set_finding_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "state", + "type": ".google.cloud.securitycenter.v1p1beta1.Finding.State" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "SetFindingState", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingState", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_async", + "title": "SecurityCenter setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on the specified Source.", + "canonical": true, + "file": "security_center.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicy", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_async", + "title": "SecurityCenter testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns the permissions that a caller has on the specified source.", + "canonical": true, + "file": "security_center.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissions", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_async", + "title": "SecurityCenter updateFinding Sample", + "origin": "API_DEFINITION", + "description": " Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.", + "canonical": true, + "file": "security_center.update_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFinding", + "async": true, + "parameters": [ + { + "name": "finding", + "type": ".google.cloud.securitycenter.v1p1beta1.Finding" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Finding", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateFinding", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFinding", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_async", + "title": "SecurityCenter updateNotificationConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter", + "canonical": true, + "file": "security_center.update_notification_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfig", + "async": true, + "parameters": [ + { + "name": "notification_config", + "type": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.NotificationConfig", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateNotificationConfig", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfig", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async", + "title": "SecurityCenter updateOrganizationSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates an organization's settings.", + "canonical": true, + "file": "security_center.update_organization_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettings", + "async": true, + "parameters": [ + { + "name": "organization_settings", + "type": ".google.cloud.securitycenter.v1p1beta1.OrganizationSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.OrganizationSettings", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateOrganizationSettings", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettings", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_async", + "title": "SecurityCenter updateSource Sample", + "origin": "API_DEFINITION", + "description": " Updates a source.", + "canonical": true, + "file": "security_center.update_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSource", + "async": true, + "parameters": [ + { + "name": "source", + "type": ".google.cloud.securitycenter.v1p1beta1.Source" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.Source", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSource", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSource", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + }, + { + "regionTag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_async", + "title": "SecurityCenter updateSecurityMarks Sample", + "origin": "API_DEFINITION", + "description": " Updates security marks.", + "canonical": true, + "file": "security_center.update_security_marks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarks", + "async": true, + "parameters": [ + { + "name": "security_marks", + "type": ".google.cloud.securitycenter.v1p1beta1.SecurityMarks" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.securitycenter.v1p1beta1.SecurityMarks", + "client": { + "shortName": "SecurityCenterClient", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenterClient" + }, + "method": { + "shortName": "UpdateSecurityMarks", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarks", + "service": { + "shortName": "SecurityCenter", + "fullName": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json new file mode 100644 index 00000000000..2ed25194e46 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "nodejs-security-center-samples", + "private": true, + "files": [ + "**/*.js", + "!system-test/" + ], + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "test": "mocha system-test/ --recursive --timeout 6000000" + }, + "license": "Apache-2.0", + "dependencies": { + "@google-cloud/pubsub": "^3.0.0", + "@google-cloud/security-center": "^7.0.0" + }, + "devDependencies": { + "chai": "^4.2.0", + "mocha": "^8.0.0", + "uuid": "^9.0.0" + } +} \ No newline at end of file diff --git a/packages/google-cloud-securitycenter/samples/quickstart.js b/packages/google-cloud-securitycenter/samples/quickstart.js new file mode 100644 index 00000000000..d0f4e5a50a3 --- /dev/null +++ b/packages/google-cloud-securitycenter/samples/quickstart.js @@ -0,0 +1,44 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +// sample-metadata: +// usage: node quickstart.js [organization] + +'use strict'; + +async function main( + organization = 'YOUR_ORGANIZATION' // Your GCP organization +) { + // [START securitycenter_quickstart] + const sc = require('@google-cloud/security-center'); + + // Create a client + const client = new sc.SecurityCenterClient(); + + async function quickstart() { + // TODO(developer): choose the organization to use + // const organization = 'your-organization'; + const [source] = await client.createSource({ + parent: client.organizationPath(organization), + source: {}, + }); + // The newly created source. + console.log('Source created.'); + console.log(source); + } + quickstart(); + // [END securitycenter_quickstart] +} + +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-securitycenter/src/index.ts b/packages/google-cloud-securitycenter/src/index.ts new file mode 100644 index 00000000000..2f1843814ee --- /dev/null +++ b/packages/google-cloud-securitycenter/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 v1beta1 from './v1beta1'; +import * as v1p1beta1 from './v1p1beta1'; + +const SecurityCenterClient = v1.SecurityCenterClient; +type SecurityCenterClient = v1.SecurityCenterClient; + +export {v1, v1beta1, v1p1beta1, SecurityCenterClient}; +export default {v1, v1beta1, v1p1beta1, SecurityCenterClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json b/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..adec8cae59d --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/gapic_metadata.json @@ -0,0 +1,415 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.securitycenter.v1", + "libraryPackage": "@google-cloud/security-center", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "CreateMuteConfig": { + "methods": [ + "createMuteConfig" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "createNotificationConfig" + ] + }, + "DeleteMuteConfig": { + "methods": [ + "deleteMuteConfig" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "deleteNotificationConfig" + ] + }, + "GetBigQueryExport": { + "methods": [ + "getBigQueryExport" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetMuteConfig": { + "methods": [ + "getMuteConfig" + ] + }, + "GetNotificationConfig": { + "methods": [ + "getNotificationConfig" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetMute": { + "methods": [ + "setMute" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateExternalSystem": { + "methods": [ + "updateExternalSystem" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateMuteConfig": { + "methods": [ + "updateMuteConfig" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "updateNotificationConfig" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "CreateBigQueryExport": { + "methods": [ + "createBigQueryExport" + ] + }, + "DeleteBigQueryExport": { + "methods": [ + "deleteBigQueryExport" + ] + }, + "UpdateBigQueryExport": { + "methods": [ + "updateBigQueryExport" + ] + }, + "BulkMuteFindings": { + "methods": [ + "bulkMuteFindings" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListMuteConfigs": { + "methods": [ + "listMuteConfigs", + "listMuteConfigsStream", + "listMuteConfigsAsync" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "listNotificationConfigs", + "listNotificationConfigsStream", + "listNotificationConfigsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + }, + "ListBigQueryExports": { + "methods": [ + "listBigQueryExports", + "listBigQueryExportsStream", + "listBigQueryExportsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "CreateMuteConfig": { + "methods": [ + "createMuteConfig" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "createNotificationConfig" + ] + }, + "DeleteMuteConfig": { + "methods": [ + "deleteMuteConfig" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "deleteNotificationConfig" + ] + }, + "GetBigQueryExport": { + "methods": [ + "getBigQueryExport" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetMuteConfig": { + "methods": [ + "getMuteConfig" + ] + }, + "GetNotificationConfig": { + "methods": [ + "getNotificationConfig" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetMute": { + "methods": [ + "setMute" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateExternalSystem": { + "methods": [ + "updateExternalSystem" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateMuteConfig": { + "methods": [ + "updateMuteConfig" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "updateNotificationConfig" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "CreateBigQueryExport": { + "methods": [ + "createBigQueryExport" + ] + }, + "DeleteBigQueryExport": { + "methods": [ + "deleteBigQueryExport" + ] + }, + "UpdateBigQueryExport": { + "methods": [ + "updateBigQueryExport" + ] + }, + "BulkMuteFindings": { + "methods": [ + "bulkMuteFindings" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListMuteConfigs": { + "methods": [ + "listMuteConfigs", + "listMuteConfigsStream", + "listMuteConfigsAsync" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "listNotificationConfigs", + "listNotificationConfigsStream", + "listNotificationConfigsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + }, + "ListBigQueryExports": { + "methods": [ + "listBigQueryExports", + "listBigQueryExportsStream", + "listBigQueryExportsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-securitycenter/src/v1/index.ts b/packages/google-cloud-securitycenter/src/v1/index.ts new file mode 100644 index 00000000000..d7817680667 --- /dev/null +++ b/packages/google-cloud-securitycenter/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 {SecurityCenterClient} from './security_center_client'; diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts new file mode 100644 index 00000000000..9246d4a8dc4 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -0,0 +1,8175 @@ +// 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, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/security_center_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './security_center_client_config.json'; +const version = require('../../../package.json').version; + +/** + * V1 APIs for Security Center service. + * @class + * @memberof v1 + */ +export class SecurityCenterClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + securityCenterStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SecurityCenterClient. + * + * @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 SecurityCenterClient({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 SecurityCenterClient; + 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 = { + folderAssetPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}' + ), + folderAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}/securityMarks' + ), + folderExportPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/bigQueryExports/{export}' + ), + folderMuteConfigPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/muteConfigs/{mute_config}' + ), + folderNotificationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/notificationConfigs/{notification_config}' + ), + folderSourcePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}' + ), + folderSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}' + ), + folderSourceFindingExternalsystemPathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}' + ), + folderSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}/securityMarks' + ), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + organizationAssetPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}' + ), + organizationAssetSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' + ), + organizationExportPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/bigQueryExports/{export}' + ), + organizationMuteConfigPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/muteConfigs/{mute_config}' + ), + organizationNotificationConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationConfigs/{notification_config}' + ), + organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/organizationSettings' + ), + organizationSourcePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}' + ), + organizationSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), + organizationSourceFindingExternalsystemPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}' + ), + organizationSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), + projectAssetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assets/{asset}' + ), + projectAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assets/{asset}/securityMarks' + ), + projectExportPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/bigQueryExports/{export}' + ), + projectMuteConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/muteConfigs/{mute_config}' + ), + projectNotificationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/notificationConfigs/{notification_config}' + ), + projectSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}' + ), + projectSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}' + ), + projectSourceFindingExternalsystemPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}' + ), + projectSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}/securityMarks' + ), + }; + + // 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 = { + groupAssets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groupByResults' + ), + groupFindings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groupByResults' + ), + listAssets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'listAssetsResults' + ), + listFindings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'listFindingsResults' + ), + listMuteConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'muteConfigs' + ), + listNotificationConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'notificationConfigs' + ), + listSources: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'sources' + ), + listBigQueryExports: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'bigQueryExports' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=organizations/*/operations/*}:cancel', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=organizations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=organizations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=organizations/*/operations}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const bulkMuteFindingsResponse = protoFilesRoot.lookup( + '.google.cloud.securitycenter.v1.BulkMuteFindingsResponse' + ) as gax.protobuf.Type; + const bulkMuteFindingsMetadata = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const runAssetDiscoveryResponse = protoFilesRoot.lookup( + '.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse' + ) as gax.protobuf.Type; + const runAssetDiscoveryMetadata = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + bulkMuteFindings: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + bulkMuteFindingsResponse.decode.bind(bulkMuteFindingsResponse), + bulkMuteFindingsMetadata.decode.bind(bulkMuteFindingsMetadata) + ), + runAssetDiscovery: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), + runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.securitycenter.v1.SecurityCenter', + 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.securityCenterStub) { + return this.securityCenterStub; + } + + // Put together the "service stub" for + // google.cloud.securitycenter.v1.SecurityCenter. + this.securityCenterStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.securitycenter.v1.SecurityCenter' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.securitycenter.v1.SecurityCenter, + 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 securityCenterStubMethods = [ + 'bulkMuteFindings', + 'createSource', + 'createFinding', + 'createMuteConfig', + 'createNotificationConfig', + 'deleteMuteConfig', + 'deleteNotificationConfig', + 'getBigQueryExport', + 'getIamPolicy', + 'getMuteConfig', + 'getNotificationConfig', + 'getOrganizationSettings', + 'getSource', + 'groupAssets', + 'groupFindings', + 'listAssets', + 'listFindings', + 'listMuteConfigs', + 'listNotificationConfigs', + 'listSources', + 'runAssetDiscovery', + 'setFindingState', + 'setMute', + 'setIamPolicy', + 'testIamPermissions', + 'updateExternalSystem', + 'updateFinding', + 'updateMuteConfig', + 'updateNotificationConfig', + 'updateOrganizationSettings', + 'updateSource', + 'updateSecurityMarks', + 'createBigQueryExport', + 'deleteBigQueryExport', + 'updateBigQueryExport', + 'listBigQueryExports', + ]; + for (const methodName of securityCenterStubMethods) { + const callPromise = this.securityCenterStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.securityCenterStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'securitycenter.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 'securitycenter.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 source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * @param {google.cloud.securitycenter.v1.Source} request.source + * Required. The Source being created, only the display_name and description + * will be used. All other fields will be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * 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/security_center.create_source.js + * region_tag:securitycenter_v1_generated_SecurityCenter_CreateSource_async + */ + createSource( + request?: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.ICreateSourceRequest | undefined, + {} | undefined + ] + >; + createSource( + request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createSource( + request: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createSource( + request?: protos.google.cloud.securitycenter.v1.ICreateSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.ICreateSourceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createSource(request, options, callback); + } + /** + * Creates a finding. The corresponding source must exist for finding creation + * to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * @param {string} request.findingId + * Required. Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + * @param {google.cloud.securitycenter.v1.Finding} request.finding + * Required. The Finding being created. The name and security_marks will be + * ignored as they are both output only fields on this resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.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/security_center.create_finding.js + * region_tag:securitycenter_v1_generated_SecurityCenter_CreateFinding_async + */ + createFinding( + request?: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ICreateFindingRequest | undefined, + {} | undefined + ] + >; + createFinding( + request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createFinding( + request: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createFinding( + request?: protos.google.cloud.securitycenter.v1.ICreateFindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ICreateFindingRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createFinding(request, options, callback); + } + /** + * Creates a mute config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new mute configs's parent. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + * @param {google.cloud.securitycenter.v1.MuteConfig} request.muteConfig + * Required. The mute config being created. + * @param {string} request.muteConfigId + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of lower case letters, numbers, and hyphen, with the first + * character a letter, the last a letter or a number, and a 63 character + * maximum. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. + * 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/security_center.create_mute_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_async + */ + createMuteConfig( + request?: protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + ( + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | undefined + ), + {} | undefined + ] + >; + createMuteConfig( + request: protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createMuteConfig( + request: protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createMuteConfig( + request?: protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + ( + | protos.google.cloud.securitycenter.v1.ICreateMuteConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createMuteConfig(request, options, callback); + } + /** + * Creates a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new notification config's parent. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + * @param {string} request.configId + * Required. + * Unique identifier provided by the client within the parent scope. + * It must be between 1 and 128 characters, and contains alphanumeric + * characters, underscores or hyphens only. + * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig + * Required. The notification config being created. The name and the service + * account will be ignored as they are both output only fields on this + * resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. + * 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/security_center.create_notification_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_async + */ + createNotificationConfig( + request?: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.INotificationConfig, + ( + | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + createNotificationConfig( + request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createNotificationConfig( + request: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createNotificationConfig( + request?: protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.INotificationConfig, + ( + | protos.google.cloud.securitycenter.v1.ICreateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createNotificationConfig( + request, + options, + callback + ); + } + /** + * Deletes an existing mute config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the mute config to delete. Its format is + * organizations/{organization}/muteConfigs/{config_id}, + * folders/{folder}/muteConfigs/{config_id}, or + * projects/{project}/muteConfigs/{config_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [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/security_center.delete_mute_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_async + */ + deleteMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteMuteConfig( + request: protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteMuteConfig( + request: protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1.IDeleteMuteConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.deleteMuteConfig(request, options, callback); + } + /** + * Deletes a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the notification config to delete. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [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/security_center.delete_notification_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_async + */ + deleteNotificationConfig( + request?: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteNotificationConfig( + request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteNotificationConfig( + request: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteNotificationConfig( + request?: protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1.IDeleteNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.deleteNotificationConfig( + request, + options, + callback + ); + } + /** + * Gets a big query export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the big query export to retrieve. Its format is + * organizations/{organization}/bigQueryExports/{export_id}, + * folders/{folder}/bigQueryExports/{export_id}, or + * projects/{project}/bigQueryExports/{export_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BigQueryExport]{@link google.cloud.securitycenter.v1.BigQueryExport}. + * 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/security_center.get_big_query_export.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_async + */ + getBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + ( + | protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest + | undefined + ), + {} | undefined + ] + >; + getBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + ( + | protos.google.cloud.securitycenter.v1.IGetBigQueryExportRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getBigQueryExport(request, options, callback); + } + /** + * Gets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * 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/security_center.get_iam_policy.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + /** + * Gets a mute config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the mute config to retrieve. Its format is + * organizations/{organization}/muteConfigs/{config_id}, + * folders/{folder}/muteConfigs/{config_id}, or + * projects/{project}/muteConfigs/{config_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. + * 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/security_center.get_mute_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetMuteConfig_async + */ + getMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest | undefined, + {} | undefined + ] + >; + getMuteConfig( + request: protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMuteConfig( + request: protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + protos.google.cloud.securitycenter.v1.IGetMuteConfigRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getMuteConfig(request, options, callback); + } + /** + * Gets a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the notification config to get. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. + * 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/security_center.get_notification_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_async + */ + getNotificationConfig( + request?: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.INotificationConfig, + ( + | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + getNotificationConfig( + request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getNotificationConfig( + request: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getNotificationConfig( + request?: protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.INotificationConfig, + ( + | protos.google.cloud.securitycenter.v1.IGetNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getNotificationConfig(request, options, callback); + } + /** + * Gets the settings for an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the organization to get organization settings for. Its + * format is "organizations/[organization_id]/organizationSettings". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. + * 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/security_center.get_organization_settings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_async + */ + getOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + ( + | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + >; + getOrganizationSettings( + request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOrganizationSettings( + request: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + ( + | protos.google.cloud.securitycenter.v1.IGetOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getOrganizationSettings( + request, + options, + callback + ); + } + /** + * Gets a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * 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/security_center.get_source.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GetSource_async + */ + getSource( + request?: protos.google.cloud.securitycenter.v1.IGetSourceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IGetSourceRequest | undefined, + {} | undefined + ] + >; + getSource( + request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSource( + request: protos.google.cloud.securitycenter.v1.IGetSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSource( + request?: protos.google.cloud.securitycenter.v1.IGetSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IGetSourceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getSource(request, options, callback); + } + /** + * Updates the state of a finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}". + * @param {google.cloud.securitycenter.v1.Finding.State} request.state + * Required. The desired State of the finding. + * @param {google.protobuf.Timestamp} request.startTime + * Required. The time at which the updated state takes effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.securitycenter.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/security_center.set_finding_state.js + * region_tag:securitycenter_v1_generated_SecurityCenter_SetFindingState_async + */ + setFindingState( + request?: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetFindingStateRequest | undefined, + {} | undefined + ] + >; + setFindingState( + request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setFindingState( + request: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setFindingState( + request?: protos.google.cloud.securitycenter.v1.ISetFindingStateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetFindingStateRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.setFindingState(request, options, callback); + } + /** + * Updates the mute state of a finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + * "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + * "projects/{project_id}/sources/{source_id}/findings/{finding_id}". + * @param {google.cloud.securitycenter.v1.Finding.Mute} request.mute + * Required. The desired state of the Mute. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.securitycenter.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/security_center.set_mute.js + * region_tag:securitycenter_v1_generated_SecurityCenter_SetMute_async + */ + setMute( + request?: protos.google.cloud.securitycenter.v1.ISetMuteRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | undefined, + {} | undefined + ] + >; + setMute( + request: protos.google.cloud.securitycenter.v1.ISetMuteRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | null | undefined, + {} | null | undefined + > + ): void; + setMute( + request: protos.google.cloud.securitycenter.v1.ISetMuteRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | null | undefined, + {} | null | undefined + > + ): void; + setMute( + request?: protos.google.cloud.securitycenter.v1.ISetMuteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.ISetMuteRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.ISetMuteRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.setMute(request, options, callback); + } + /** + * Sets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * 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/security_center.set_iam_policy.js + * region_tag:securitycenter_v1_generated_SecurityCenter_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + /** + * Returns the permissions that a caller has on the specified source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * 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/security_center.test_iam_permissions.js + * region_tag:securitycenter_v1_generated_SecurityCenter_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + /** + * Updates external system. This is for a given finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.ExternalSystem} request.externalSystem + * Required. The external system resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the external system resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ExternalSystem]{@link google.cloud.securitycenter.v1.ExternalSystem}. + * 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/security_center.update_external_system.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_async + */ + updateExternalSystem( + request?: protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IExternalSystem, + ( + | protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest + | undefined + ), + {} | undefined + ] + >; + updateExternalSystem( + request: protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IExternalSystem, + | protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateExternalSystem( + request: protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IExternalSystem, + | protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateExternalSystem( + request?: protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IExternalSystem, + | protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IExternalSystem, + | protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IExternalSystem, + ( + | protos.google.cloud.securitycenter.v1.IUpdateExternalSystemRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'external_system.name': request.externalSystem!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateExternalSystem(request, options, callback); + } + /** + * Creates or updates a finding. The corresponding source must exist for a + * finding creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.Finding} request.finding + * Required. The finding resource to update or create if it does not already + * exist. parent, security_marks, and update_time will be ignored. + * + * In the case of creation, the finding id portion of the name must be + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * + * When updating a finding, an empty mask is treated as updating all mutable + * fields and replacing source_properties. Individual source_properties can + * be added/updated by using "source_properties." in the field + * mask. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.securitycenter.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/security_center.update_finding.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateFinding_async + */ + updateFinding( + request?: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.IUpdateFindingRequest | undefined, + {} | undefined + ] + >; + updateFinding( + request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateFinding( + request: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateFinding( + request?: protos.google.cloud.securitycenter.v1.IUpdateFindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IFinding, + | protos.google.cloud.securitycenter.v1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IFinding, + protos.google.cloud.securitycenter.v1.IUpdateFindingRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'finding.name': request.finding!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateFinding(request, options, callback); + } + /** + * Updates a mute config. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.MuteConfig} request.muteConfig + * Required. The mute config being updated. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. + * 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/security_center.update_mute_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_async + */ + updateMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + ( + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateMuteConfig( + request: protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateMuteConfig( + request: protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateMuteConfig( + request?: protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IMuteConfig, + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig, + ( + | protos.google.cloud.securitycenter.v1.IUpdateMuteConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'mute_config.name': request.muteConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateMuteConfig(request, options, callback); + } + /** + * + * Updates a notification config. The following update + * fields are allowed: description, pubsub_topic, streaming_config.filter + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.NotificationConfig} request.notificationConfig + * Required. The notification config to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the notification config. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. + * 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/security_center.update_notification_config.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_async + */ + updateNotificationConfig( + request?: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.INotificationConfig, + ( + | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateNotificationConfig( + request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateNotificationConfig( + request: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateNotificationConfig( + request?: protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.INotificationConfig, + | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.INotificationConfig, + ( + | protos.google.cloud.securitycenter.v1.IUpdateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'notification_config.name': request.notificationConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateNotificationConfig( + request, + options, + callback + ); + } + /** + * Updates an organization's settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.OrganizationSettings} request.organizationSettings + * Required. The organization settings resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the settings resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1.OrganizationSettings}. + * 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/security_center.update_organization_settings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_async + */ + updateOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + ( + | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + >; + updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IOrganizationSettings, + ( + | protos.google.cloud.securitycenter.v1.IUpdateOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateOrganizationSettings( + request, + options, + callback + ); + } + /** + * Updates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.Source} request.source + * Required. The source resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the source resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1.Source}. + * 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/security_center.update_source.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateSource_async + */ + updateSource( + request?: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IUpdateSourceRequest | undefined, + {} | undefined + ] + >; + updateSource( + request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSource( + request: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSource( + request?: protos.google.cloud.securitycenter.v1.IUpdateSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISource, + | protos.google.cloud.securitycenter.v1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISource, + protos.google.cloud.securitycenter.v1.IUpdateSourceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'source.name': request.source!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSource(request, options, callback); + } + /** + * Updates security marks. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.SecurityMarks} request.securityMarks + * Required. The security marks resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the security marks resource. + * + * The field mask must not contain duplicate fields. + * If empty or set to "marks", all marks will be replaced. Individual + * marks can be updated using "marks.". + * @param {google.protobuf.Timestamp} request.startTime + * The time at which the updated SecurityMarks take effect. + * If not set uses current server time. Updates will be applied to the + * SecurityMarks that are active immediately preceding this time. Must be + * earlier or equal to the server time. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1.SecurityMarks}. + * 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/security_center.update_security_marks.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_async + */ + updateSecurityMarks( + request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISecurityMarks, + ( + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + >; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSecurityMarks( + request?: protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISecurityMarks, + ( + | protos.google.cloud.securitycenter.v1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSecurityMarks(request, options, callback); + } + /** + * Creates a big query export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new big query export's parent. Its format is + * "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + * @param {google.cloud.securitycenter.v1.BigQueryExport} request.bigQueryExport + * Required. The big query export being created. + * @param {string} request.bigQueryExportId + * Required. Unique identifier provided by the client within the parent scope. + * It must consist of lower case letters, numbers, and hyphen, with the first + * character a letter, the last a letter or a number, and a 63 character + * maximum. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BigQueryExport]{@link google.cloud.securitycenter.v1.BigQueryExport}. + * 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/security_center.create_big_query_export.js + * region_tag:securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_async + */ + createBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + ( + | protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest + | undefined + ), + {} | undefined + ] + >; + createBigQueryExport( + request: protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createBigQueryExport( + request: protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + ( + | protos.google.cloud.securitycenter.v1.ICreateBigQueryExportRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createBigQueryExport(request, options, callback); + } + /** + * Deletes an existing big query export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the big query export to delete. Its format is + * organizations/{organization}/bigQueryExports/{export_id}, + * folders/{folder}/bigQueryExports/{export_id}, or + * projects/{project}/bigQueryExports/{export_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [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/security_center.delete_big_query_export.js + * region_tag:securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_async + */ + deleteBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest + | undefined + ), + {} | undefined + ] + >; + deleteBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1.IDeleteBigQueryExportRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.deleteBigQueryExport(request, options, callback); + } + /** + * Updates a BigQuery export. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1.BigQueryExport} request.bigQueryExport + * Required. The BigQuery export being updated. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BigQueryExport]{@link google.cloud.securitycenter.v1.BigQueryExport}. + * 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/security_center.update_big_query_export.js + * region_tag:securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_async + */ + updateBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + ( + | protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest + | undefined + ), + {} | undefined + ] + >; + updateBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateBigQueryExport( + request: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateBigQueryExport( + request?: protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1.IBigQueryExport, + | protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport, + ( + | protos.google.cloud.securitycenter.v1.IUpdateBigQueryExportRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'big_query_export.name': request.bigQueryExport!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateBigQueryExport(request, options, callback); + } + + /** + * Kicks off an LRO to bulk mute findings for a parent based on a filter. The + * parent can be either an organization, folder or project. The findings + * matched by the filter will be muted after the LRO is done. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, at which bulk action needs to be applied. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {string} request.filter + * Expression that identifies findings that should be updated. + * The expression is a list of zero or more restrictions combined + * via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + * has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a + * `-` character in front of them to indicate negation. The fields map to + * those defined in the corresponding resource. + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * @param {string} request.muteAnnotation + * This can be a mute configuration name or any identifier for mute/unmute + * of findings based on the filter. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/security_center.bulk_mute_findings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async + */ + bulkMuteFindings( + request?: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + bulkMuteFindings( + request: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + bulkMuteFindings( + request: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + callback: Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + bulkMuteFindings( + request?: protos.google.cloud.securitycenter.v1.IBulkMuteFindingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.bulkMuteFindings(request, options, callback); + } + /** + * Check the status of the long running operation returned by `bulkMuteFindings()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/security_center.bulk_mute_findings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_async + */ + async checkBulkMuteFindingsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.securitycenter.v1.BulkMuteFindingsResponse, + protos.google.protobuf.Empty + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.bulkMuteFindings, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.securitycenter.v1.BulkMuteFindingsResponse, + protos.google.protobuf.Empty + >; + } + /** + * Runs asset discovery. The discovery is tracked with a long-running + * operation. + * + * This API can only be called with limited frequency for an organization. If + * it is called too frequently the caller will receive a TOO_MANY_REQUESTS + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to run asset discovery for. Its format + * is "organizations/[organization_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async + */ + runAssetDiscovery( + request?: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + callback: Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runAssetDiscovery( + request?: protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.runAssetDiscovery(request, options, callback); + } + /** + * Check the status of the long running operation returned by `runAssetDiscovery()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_async + */ + async checkRunAssetDiscoveryProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse, + protos.google.protobuf.Empty + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.runAssetDiscovery, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse, + protos.google.protobuf.Empty + >; + } + /** + * Filters an organization's assets and groups them by their specified + * properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. + * 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 `groupAssetsAsync()` + * 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. + */ + groupAssets( + request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + ] + >; + groupAssets( + request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + > + ): void; + groupAssets( + request: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + > + ): void; + groupAssets( + request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1.IGroupAssetsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.groupAssets(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. Name of the organization to groupBy. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} 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 `groupAssetsAsync()` + * 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. + */ + groupAssetsStream( + request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + 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['groupAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.groupAssets.createStream( + this.innerApiCalls.groupAssets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `groupAssets`, 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. Name of the organization to groupBy. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. + * The string value should follow SQL syntax: comma separated list of fields. + * For example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. 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/security_center.group_assets.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GroupAssets_async + */ + groupAssetsAsync( + request?: protos.google.cloud.securitycenter.v1.IGroupAssetsRequest, + 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['groupAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.groupAssets.asyncIterate( + this.innerApiCalls['groupAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Filters an organization or source's findings and groups them by their + * specified properties. + * + * To group across all sources provide a `-` as the source id. + * Example: /v1/organizations/{organization_id}/sources/-/findings, + * /v1/folders/{folder_id}/sources/-/findings, + * /v1/projects/{project_id}/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * + * * severity: `=`, `:` + * * workflow_state: `=`, `:` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * * severity + * + * The following fields are supported when compare_duration is set: + * + * * state_change + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. + * 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 `groupFindingsAsync()` + * 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. + */ + groupFindings( + request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + ] + >; + groupFindings( + request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + > + ): void; + groupFindings( + request: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + > + ): void; + groupFindings( + request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IGroupResult + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IGroupResult[], + protos.google.cloud.securitycenter.v1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1.IGroupFindingsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.groupFindings(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. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * + * * severity: `=`, `:` + * * workflow_state: `=`, `:` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * * severity + * + * The following fields are supported when compare_duration is set: + * + * * state_change + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult} 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 `groupFindingsAsync()` + * 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. + */ + groupFindingsStream( + request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + 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['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.groupFindings.createStream( + this.innerApiCalls.groupFindings as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `groupFindings`, 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. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * + * * severity: `=`, `:` + * * workflow_state: `=`, `:` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping + * (including `state_change`). The string value should follow SQL syntax: + * comma separated list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * * severity + * + * The following fields are supported when compare_duration is set: + * + * * state_change + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [GroupResult]{@link google.cloud.securitycenter.v1.GroupResult}. 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/security_center.group_findings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_GroupFindings_async + */ + groupFindingsAsync( + request?: protos.google.cloud.securitycenter.v1.IGroupFindingsRequest, + 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['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.groupFindings.asyncIterate( + this.innerApiCalls['groupFindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists an organization's assets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following are the allowed field and operator combinations: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult}. + * 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 `listAssetsAsync()` + * 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. + */ + listAssets( + request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1.IListAssetsResponse + ] + >; + listAssets( + request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult + > + ): void; + listAssets( + request: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult + > + ): void; + listAssets( + request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1.IListAssetsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listAssets(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. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following are the allowed field and operator combinations: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} 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 `listAssetsAsync()` + * 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. + */ + listAssetsStream( + request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + 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['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssets.createStream( + this.innerApiCalls.listAssets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAssets`, 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. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following are the allowed field and operator combinations: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [ListAssetsResult]{@link google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult}. 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/security_center.list_assets.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListAssets_async + */ + listAssetsAsync( + request?: protos.google.cloud.securitycenter.v1.IListAssetsRequest, + 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['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists an organization or source's findings. + * + * To list across all sources provide a `-` as the source id. + * Example: /v1/organizations/{organization_id}/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * + * * severity: `=`, `:` + * * workflow_state: `=`, `:` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + * * resource.folders.resource_folder: `=`, `:` + * * resource.display_name: `=`, `:` + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult}. + * 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.securitycenter.v1.IListFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1.IListFindingsResponse + ] + >; + listFindings( + request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult + > + ): void; + listFindings( + request: protos.google.cloud.securitycenter.v1.IListFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult + > + ): void; + listFindings( + request?: protos.google.cloud.securitycenter.v1.IListFindingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.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. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * + * * severity: `=`, `:` + * * workflow_state: `=`, `:` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + * * resource.folders.resource_folder: `=`, `:` + * * resource.display_name: `=`, `:` + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} 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.securitycenter.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. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * + * * severity: `=`, `:` + * * workflow_state: `=`, `:` + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * + * * resource: + * * resource.name: `=`, `:` + * * resource.parent_name: `=`, `:` + * * resource.parent_display_name: `=`, `:` + * * resource.project_name: `=`, `:` + * * resource.project_display_name: `=`, `:` + * * resource.type: `=`, `:` + * * resource.folders.resource_folder: `=`, `:` + * * resource.display_name: `=`, `:` + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [ListFindingsResult]{@link google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult}. 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/security_center.list_findings.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListFindings_async + */ + listFindingsAsync( + request?: protos.google.cloud.securitycenter.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; + } + /** + * Lists mute configs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListMuteConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMuteConfigs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. + * 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 `listMuteConfigsAsync()` + * 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. + */ + listMuteConfigs( + request?: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig[], + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest | null, + protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + ] + >; + listMuteConfigs( + request: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IMuteConfig + > + ): void; + listMuteConfigs( + request: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IMuteConfig + > + ): void; + listMuteConfigs( + request?: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IMuteConfig + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IMuteConfig + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IMuteConfig[], + protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest | null, + protos.google.cloud.securitycenter.v1.IListMuteConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listMuteConfigs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListMuteConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMuteConfigs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig} 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 `listMuteConfigsAsync()` + * 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. + */ + listMuteConfigsStream( + request?: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + 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['listMuteConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMuteConfigs.createStream( + this.innerApiCalls.listMuteConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listMuteConfigs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of mute configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListMuteConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMuteConfigs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [MuteConfig]{@link google.cloud.securitycenter.v1.MuteConfig}. 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/security_center.list_mute_configs.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_async + */ + listMuteConfigsAsync( + request?: protos.google.cloud.securitycenter.v1.IListMuteConfigsRequest, + 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['listMuteConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMuteConfigs.asyncIterate( + this.innerApiCalls['listMuteConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists notification configs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to list notification configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. + * 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 `listNotificationConfigsAsync()` + * 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. + */ + listNotificationConfigs( + request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.INotificationConfig[], + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, + protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + ] + >; + listNotificationConfigs( + request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.INotificationConfig + > + ): void; + listNotificationConfigs( + request: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.INotificationConfig + > + ): void; + listNotificationConfigs( + request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.INotificationConfig + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.INotificationConfig + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.INotificationConfig[], + protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest | null, + protos.google.cloud.securitycenter.v1.IListNotificationConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listNotificationConfigs( + 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. Name of the organization to list notification configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig} 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 `listNotificationConfigsAsync()` + * 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. + */ + listNotificationConfigsStream( + request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + 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['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNotificationConfigs.createStream( + this.innerApiCalls.listNotificationConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listNotificationConfigs`, 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. Name of the organization to list notification configs. Its format + * is "organizations/[organization_id]", "folders/[folder_id]", or + * "projects/[project_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [NotificationConfig]{@link google.cloud.securitycenter.v1.NotificationConfig}. 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/security_center.list_notification_configs.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_async + */ + listNotificationConfigsAsync( + request?: protos.google.cloud.securitycenter.v1.IListNotificationConfigsRequest, + 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['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNotificationConfigs.asyncIterate( + this.innerApiCalls['listNotificationConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all sources belonging to an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Source]{@link google.cloud.securitycenter.v1.Source}. + * 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 `listSourcesAsync()` + * 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. + */ + listSources( + request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISource[], + protos.google.cloud.securitycenter.v1.IListSourcesRequest | null, + protos.google.cloud.securitycenter.v1.IListSourcesResponse + ] + >; + listSources( + request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ISource + > + ): void; + listSources( + request: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ISource + > + ): void; + listSources( + request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ISource + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.ISource + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.ISource[], + protos.google.cloud.securitycenter.v1.IListSourcesRequest | null, + protos.google.cloud.securitycenter.v1.IListSourcesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listSources(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [Source]{@link google.cloud.securitycenter.v1.Source} 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 `listSourcesAsync()` + * 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. + */ + listSourcesStream( + request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + 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['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSources.createStream( + this.innerApiCalls.listSources as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSources`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should + * be "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [Source]{@link google.cloud.securitycenter.v1.Source}. 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/security_center.list_sources.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListSources_async + */ + listSourcesAsync( + request?: protos.google.cloud.securitycenter.v1.IListSourcesRequest, + 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['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSources.asyncIterate( + this.innerApiCalls['listSources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists BigQuery exports. Note that when requesting BigQuery exports at a + * given level all exports under that level are also returned e.g. if + * requesting BigQuery exports under a folder, then all BigQuery exports + * immediately under the folder plus the ones created under the projects + * within the folder are returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListBigQueryExports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListBigQueryExports` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [BigQueryExport]{@link google.cloud.securitycenter.v1.BigQueryExport}. + * 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 `listBigQueryExportsAsync()` + * 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. + */ + listBigQueryExports( + request?: protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport[], + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest | null, + protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse + ] + >; + listBigQueryExports( + request: protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + | protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IBigQueryExport + > + ): void; + listBigQueryExports( + request: protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + | protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IBigQueryExport + > + ): void; + listBigQueryExports( + request?: protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + | protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IBigQueryExport + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + | protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1.IBigQueryExport + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1.IBigQueryExport[], + protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest | null, + protos.google.cloud.securitycenter.v1.IListBigQueryExportsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listBigQueryExports(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListBigQueryExports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListBigQueryExports` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [BigQueryExport]{@link google.cloud.securitycenter.v1.BigQueryExport} 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 `listBigQueryExportsAsync()` + * 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. + */ + listBigQueryExportsStream( + request?: protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + 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['listBigQueryExports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBigQueryExports.createStream( + this.innerApiCalls.listBigQueryExports as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listBigQueryExports`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns the collection of BigQuery exports. Its + * format is "organizations/[organization_id]", "folders/[folder_id]", + * "projects/[project_id]". + * @param {number} request.pageSize + * The maximum number of configs to return. The service may return fewer than + * this value. + * If unspecified, at most 10 configs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListBigQueryExports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListBigQueryExports` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [BigQueryExport]{@link google.cloud.securitycenter.v1.BigQueryExport}. 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/security_center.list_big_query_exports.js + * region_tag:securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_async + */ + listBigQueryExportsAsync( + request?: protos.google.cloud.securitycenter.v1.IListBigQueryExportsRequest, + 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['listBigQueryExports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBigQueryExports.asyncIterate( + this.innerApiCalls['listBigQueryExports'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderAsset resource name string. + * + * @param {string} folder + * @param {string} asset + * @returns {string} Resource name string. + */ + folderAssetPath(folder: string, asset: string) { + return this.pathTemplates.folderAssetPathTemplate.render({ + folder: folder, + asset: asset, + }); + } + + /** + * Parse the folder from FolderAsset resource. + * + * @param {string} folderAssetName + * A fully-qualified path representing folder_asset resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAssetName(folderAssetName: string) { + return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName) + .folder; + } + + /** + * Parse the asset from FolderAsset resource. + * + * @param {string} folderAssetName + * A fully-qualified path representing folder_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromFolderAssetName(folderAssetName: string) { + return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName) + .asset; + } + + /** + * Return a fully-qualified folderAssetSecurityMarks resource name string. + * + * @param {string} folder + * @param {string} asset + * @returns {string} Resource name string. + */ + folderAssetSecurityMarksPath(folder: string, asset: string) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.render({ + folder: folder, + asset: asset, + }); + } + + /** + * Parse the folder from FolderAssetSecurityMarks resource. + * + * @param {string} folderAssetSecurityMarksName + * A fully-qualified path representing folder_asset_securityMarks resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAssetSecurityMarksName( + folderAssetSecurityMarksName: string + ) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.match( + folderAssetSecurityMarksName + ).folder; + } + + /** + * Parse the asset from FolderAssetSecurityMarks resource. + * + * @param {string} folderAssetSecurityMarksName + * A fully-qualified path representing folder_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromFolderAssetSecurityMarksName( + folderAssetSecurityMarksName: string + ) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.match( + folderAssetSecurityMarksName + ).asset; + } + + /** + * Return a fully-qualified folderExport resource name string. + * + * @param {string} folder + * @param {string} exportParam + * @returns {string} Resource name string. + */ + folderExportPath(folder: string, exportParam: string) { + return this.pathTemplates.folderExportPathTemplate.render({ + folder: folder, + export: exportParam, + }); + } + + /** + * Parse the folder from FolderExport resource. + * + * @param {string} folderExportName + * A fully-qualified path representing folder_export resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderExportName(folderExportName: string) { + return this.pathTemplates.folderExportPathTemplate.match(folderExportName) + .folder; + } + + /** + * Parse the export from FolderExport resource. + * + * @param {string} folderExportName + * A fully-qualified path representing folder_export resource. + * @returns {string} A string representing the export. + */ + matchExportFromFolderExportName(folderExportName: string) { + return this.pathTemplates.folderExportPathTemplate.match(folderExportName) + .export; + } + + /** + * Return a fully-qualified folderMuteConfig resource name string. + * + * @param {string} folder + * @param {string} mute_config + * @returns {string} Resource name string. + */ + folderMuteConfigPath(folder: string, muteConfig: string) { + return this.pathTemplates.folderMuteConfigPathTemplate.render({ + folder: folder, + mute_config: muteConfig, + }); + } + + /** + * Parse the folder from FolderMuteConfig resource. + * + * @param {string} folderMuteConfigName + * A fully-qualified path representing folder_mute_config resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMuteConfigName(folderMuteConfigName: string) { + return this.pathTemplates.folderMuteConfigPathTemplate.match( + folderMuteConfigName + ).folder; + } + + /** + * Parse the mute_config from FolderMuteConfig resource. + * + * @param {string} folderMuteConfigName + * A fully-qualified path representing folder_mute_config resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromFolderMuteConfigName(folderMuteConfigName: string) { + return this.pathTemplates.folderMuteConfigPathTemplate.match( + folderMuteConfigName + ).mute_config; + } + + /** + * Return a fully-qualified folderNotificationConfig resource name string. + * + * @param {string} folder + * @param {string} notification_config + * @returns {string} Resource name string. + */ + folderNotificationConfigPath(folder: string, notificationConfig: string) { + return this.pathTemplates.folderNotificationConfigPathTemplate.render({ + folder: folder, + notification_config: notificationConfig, + }); + } + + /** + * Parse the folder from FolderNotificationConfig resource. + * + * @param {string} folderNotificationConfigName + * A fully-qualified path representing folder_notification_config resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderNotificationConfigName( + folderNotificationConfigName: string + ) { + return this.pathTemplates.folderNotificationConfigPathTemplate.match( + folderNotificationConfigName + ).folder; + } + + /** + * Parse the notification_config from FolderNotificationConfig resource. + * + * @param {string} folderNotificationConfigName + * A fully-qualified path representing folder_notification_config resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromFolderNotificationConfigName( + folderNotificationConfigName: string + ) { + return this.pathTemplates.folderNotificationConfigPathTemplate.match( + folderNotificationConfigName + ).notification_config; + } + + /** + * Return a fully-qualified folderSource resource name string. + * + * @param {string} folder + * @param {string} source + * @returns {string} Resource name string. + */ + folderSourcePath(folder: string, source: string) { + return this.pathTemplates.folderSourcePathTemplate.render({ + folder: folder, + source: source, + }); + } + + /** + * Parse the folder from FolderSource resource. + * + * @param {string} folderSourceName + * A fully-qualified path representing folder_source resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceName(folderSourceName: string) { + return this.pathTemplates.folderSourcePathTemplate.match(folderSourceName) + .folder; + } + + /** + * Parse the source from FolderSource resource. + * + * @param {string} folderSourceName + * A fully-qualified path representing folder_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceName(folderSourceName: string) { + return this.pathTemplates.folderSourcePathTemplate.match(folderSourceName) + .source; + } + + /** + * Return a fully-qualified folderSourceFinding resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + folderSourceFindingPath(folder: string, source: string, finding: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.render({ + folder: folder, + source: source, + finding: finding, + }); + } + + /** + * Parse the folder from FolderSourceFinding resource. + * + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).folder; + } + + /** + * Parse the source from FolderSourceFinding resource. + * + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).source; + } + + /** + * Parse the finding from FolderSourceFinding resource. + * + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified folderSourceFindingExternalsystem resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} finding + * @param {string} externalsystem + * @returns {string} Resource name string. + */ + folderSourceFindingExternalsystemPath( + folder: string, + source: string, + finding: string, + externalsystem: string + ) { + return this.pathTemplates.folderSourceFindingExternalsystemPathTemplate.render( + { + folder: folder, + source: source, + finding: finding, + externalsystem: externalsystem, + } + ); + } + + /** + * Parse the folder from FolderSourceFindingExternalsystem resource. + * + * @param {string} folderSourceFindingExternalsystemName + * A fully-qualified path representing folder_source_finding_externalsystem resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceFindingExternalsystemName( + folderSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.folderSourceFindingExternalsystemPathTemplate.match( + folderSourceFindingExternalsystemName + ).folder; + } + + /** + * Parse the source from FolderSourceFindingExternalsystem resource. + * + * @param {string} folderSourceFindingExternalsystemName + * A fully-qualified path representing folder_source_finding_externalsystem resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceFindingExternalsystemName( + folderSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.folderSourceFindingExternalsystemPathTemplate.match( + folderSourceFindingExternalsystemName + ).source; + } + + /** + * Parse the finding from FolderSourceFindingExternalsystem resource. + * + * @param {string} folderSourceFindingExternalsystemName + * A fully-qualified path representing folder_source_finding_externalsystem resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceFindingExternalsystemName( + folderSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.folderSourceFindingExternalsystemPathTemplate.match( + folderSourceFindingExternalsystemName + ).finding; + } + + /** + * Parse the externalsystem from FolderSourceFindingExternalsystem resource. + * + * @param {string} folderSourceFindingExternalsystemName + * A fully-qualified path representing folder_source_finding_externalsystem resource. + * @returns {string} A string representing the externalsystem. + */ + matchExternalsystemFromFolderSourceFindingExternalsystemName( + folderSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.folderSourceFindingExternalsystemPathTemplate.match( + folderSourceFindingExternalsystemName + ).externalsystem; + } + + /** + * Return a fully-qualified folderSourceFindingSecurityMarks resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + folderSourceFindingSecurityMarksPath( + folder: string, + source: string, + finding: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.render( + { + folder: folder, + source: source, + finding: finding, + } + ); + } + + /** + * Parse the folder from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).folder; + } + + /** + * Parse the source from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).source; + } + + /** + * Parse the finding from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).finding; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Return a fully-qualified organizationAsset resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetPath(organization: string, asset: string) { + return this.pathTemplates.organizationAssetPathTemplate.render({ + organization: organization, + asset: asset, + }); + } + + /** + * Parse the organization from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { + return this.pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).organization; + } + + /** + * Parse the asset from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetName(organizationAssetName: string) { + return this.pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).asset; + } + + /** + * Return a fully-qualified organizationAssetSecurityMarks resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetSecurityMarksPath(organization: string, asset: string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render( + { + organization: organization, + asset: asset, + } + ); + } + + /** + * Parse the organization from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetSecurityMarksName( + organizationAssetSecurityMarksName: string + ) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + organizationAssetSecurityMarksName + ).organization; + } + + /** + * Parse the asset from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetSecurityMarksName( + organizationAssetSecurityMarksName: string + ) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + organizationAssetSecurityMarksName + ).asset; + } + + /** + * Return a fully-qualified organizationExport resource name string. + * + * @param {string} organization + * @param {string} exportParam + * @returns {string} Resource name string. + */ + organizationExportPath(organization: string, exportParam: string) { + return this.pathTemplates.organizationExportPathTemplate.render({ + organization: organization, + export: exportParam, + }); + } + + /** + * Parse the organization from OrganizationExport resource. + * + * @param {string} organizationExportName + * A fully-qualified path representing organization_export resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationExportName(organizationExportName: string) { + return this.pathTemplates.organizationExportPathTemplate.match( + organizationExportName + ).organization; + } + + /** + * Parse the export from OrganizationExport resource. + * + * @param {string} organizationExportName + * A fully-qualified path representing organization_export resource. + * @returns {string} A string representing the export. + */ + matchExportFromOrganizationExportName(organizationExportName: string) { + return this.pathTemplates.organizationExportPathTemplate.match( + organizationExportName + ).export; + } + + /** + * Return a fully-qualified organizationMuteConfig resource name string. + * + * @param {string} organization + * @param {string} mute_config + * @returns {string} Resource name string. + */ + organizationMuteConfigPath(organization: string, muteConfig: string) { + return this.pathTemplates.organizationMuteConfigPathTemplate.render({ + organization: organization, + mute_config: muteConfig, + }); + } + + /** + * Parse the organization from OrganizationMuteConfig resource. + * + * @param {string} organizationMuteConfigName + * A fully-qualified path representing organization_mute_config resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMuteConfigName( + organizationMuteConfigName: string + ) { + return this.pathTemplates.organizationMuteConfigPathTemplate.match( + organizationMuteConfigName + ).organization; + } + + /** + * Parse the mute_config from OrganizationMuteConfig resource. + * + * @param {string} organizationMuteConfigName + * A fully-qualified path representing organization_mute_config resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromOrganizationMuteConfigName( + organizationMuteConfigName: string + ) { + return this.pathTemplates.organizationMuteConfigPathTemplate.match( + organizationMuteConfigName + ).mute_config; + } + + /** + * Return a fully-qualified organizationNotificationConfig resource name string. + * + * @param {string} organization + * @param {string} notification_config + * @returns {string} Resource name string. + */ + organizationNotificationConfigPath( + organization: string, + notificationConfig: string + ) { + return this.pathTemplates.organizationNotificationConfigPathTemplate.render( + { + organization: organization, + notification_config: notificationConfig, + } + ); + } + + /** + * Parse the organization from OrganizationNotificationConfig resource. + * + * @param {string} organizationNotificationConfigName + * A fully-qualified path representing organization_notification_config resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationNotificationConfigName( + organizationNotificationConfigName: string + ) { + return this.pathTemplates.organizationNotificationConfigPathTemplate.match( + organizationNotificationConfigName + ).organization; + } + + /** + * Parse the notification_config from OrganizationNotificationConfig resource. + * + * @param {string} organizationNotificationConfigName + * A fully-qualified path representing organization_notification_config resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromOrganizationNotificationConfigName( + organizationNotificationConfigName: string + ) { + return this.pathTemplates.organizationNotificationConfigPathTemplate.match( + organizationNotificationConfigName + ).notification_config; + } + + /** + * Return a fully-qualified organizationSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationSettingsPath(organization: string) { + return this.pathTemplates.organizationSettingsPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from OrganizationSettings resource. + * + * @param {string} organizationSettingsName + * A fully-qualified path representing OrganizationSettings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSettingsName( + organizationSettingsName: string + ) { + return this.pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName + ).organization; + } + + /** + * Return a fully-qualified organizationSource resource name string. + * + * @param {string} organization + * @param {string} source + * @returns {string} Resource name string. + */ + organizationSourcePath(organization: string, source: string) { + return this.pathTemplates.organizationSourcePathTemplate.render({ + organization: organization, + source: source, + }); + } + + /** + * Parse the organization from OrganizationSource resource. + * + * @param {string} organizationSourceName + * A fully-qualified path representing organization_source resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceName(organizationSourceName: string) { + return this.pathTemplates.organizationSourcePathTemplate.match( + organizationSourceName + ).organization; + } + + /** + * Parse the source from OrganizationSource resource. + * + * @param {string} organizationSourceName + * A fully-qualified path representing organization_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceName(organizationSourceName: string) { + return this.pathTemplates.organizationSourcePathTemplate.match( + organizationSourceName + ).source; + } + + /** + * Return a fully-qualified organizationSourceFinding resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingPath( + organization: string, + source: string, + finding: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Parse the organization from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified organizationSourceFindingExternalsystem resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @param {string} externalsystem + * @returns {string} Resource name string. + */ + organizationSourceFindingExternalsystemPath( + organization: string, + source: string, + finding: string, + externalsystem: string + ) { + return this.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.render( + { + organization: organization, + source: source, + finding: finding, + externalsystem: externalsystem, + } + ); + } + + /** + * Parse the organization from OrganizationSourceFindingExternalsystem resource. + * + * @param {string} organizationSourceFindingExternalsystemName + * A fully-qualified path representing organization_source_finding_externalsystem resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingExternalsystemName( + organizationSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.match( + organizationSourceFindingExternalsystemName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFindingExternalsystem resource. + * + * @param {string} organizationSourceFindingExternalsystemName + * A fully-qualified path representing organization_source_finding_externalsystem resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingExternalsystemName( + organizationSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.match( + organizationSourceFindingExternalsystemName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFindingExternalsystem resource. + * + * @param {string} organizationSourceFindingExternalsystemName + * A fully-qualified path representing organization_source_finding_externalsystem resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingExternalsystemName( + organizationSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.match( + organizationSourceFindingExternalsystemName + ).finding; + } + + /** + * Parse the externalsystem from OrganizationSourceFindingExternalsystem resource. + * + * @param {string} organizationSourceFindingExternalsystemName + * A fully-qualified path representing organization_source_finding_externalsystem resource. + * @returns {string} A string representing the externalsystem. + */ + matchExternalsystemFromOrganizationSourceFindingExternalsystemName( + organizationSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.match( + organizationSourceFindingExternalsystemName + ).externalsystem; + } + + /** + * Return a fully-qualified organizationSourceFindingSecurityMarks resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingSecurityMarksPath( + organization: string, + source: string, + finding: string + ) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render( + { + organization: organization, + source: source, + finding: finding, + } + ); + } + + /** + * Parse the organization from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName + ).finding; + } + + /** + * Return a fully-qualified projectAsset resource name string. + * + * @param {string} project + * @param {string} asset + * @returns {string} Resource name string. + */ + projectAssetPath(project: string, asset: string) { + return this.pathTemplates.projectAssetPathTemplate.render({ + project: project, + asset: asset, + }); + } + + /** + * Parse the project from ProjectAsset resource. + * + * @param {string} projectAssetName + * A fully-qualified path representing project_asset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAssetName(projectAssetName: string) { + return this.pathTemplates.projectAssetPathTemplate.match(projectAssetName) + .project; + } + + /** + * Parse the asset from ProjectAsset resource. + * + * @param {string} projectAssetName + * A fully-qualified path representing project_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectAssetName(projectAssetName: string) { + return this.pathTemplates.projectAssetPathTemplate.match(projectAssetName) + .asset; + } + + /** + * Return a fully-qualified projectAssetSecurityMarks resource name string. + * + * @param {string} project + * @param {string} asset + * @returns {string} Resource name string. + */ + projectAssetSecurityMarksPath(project: string, asset: string) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.render({ + project: project, + asset: asset, + }); + } + + /** + * Parse the project from ProjectAssetSecurityMarks resource. + * + * @param {string} projectAssetSecurityMarksName + * A fully-qualified path representing project_asset_securityMarks resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAssetSecurityMarksName( + projectAssetSecurityMarksName: string + ) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.match( + projectAssetSecurityMarksName + ).project; + } + + /** + * Parse the asset from ProjectAssetSecurityMarks resource. + * + * @param {string} projectAssetSecurityMarksName + * A fully-qualified path representing project_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectAssetSecurityMarksName( + projectAssetSecurityMarksName: string + ) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.match( + projectAssetSecurityMarksName + ).asset; + } + + /** + * Return a fully-qualified projectExport resource name string. + * + * @param {string} project + * @param {string} exportParam + * @returns {string} Resource name string. + */ + projectExportPath(project: string, exportParam: string) { + return this.pathTemplates.projectExportPathTemplate.render({ + project: project, + export: exportParam, + }); + } + + /** + * Parse the project from ProjectExport resource. + * + * @param {string} projectExportName + * A fully-qualified path representing project_export resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectExportName(projectExportName: string) { + return this.pathTemplates.projectExportPathTemplate.match(projectExportName) + .project; + } + + /** + * Parse the export from ProjectExport resource. + * + * @param {string} projectExportName + * A fully-qualified path representing project_export resource. + * @returns {string} A string representing the export. + */ + matchExportFromProjectExportName(projectExportName: string) { + return this.pathTemplates.projectExportPathTemplate.match(projectExportName) + .export; + } + + /** + * Return a fully-qualified projectMuteConfig resource name string. + * + * @param {string} project + * @param {string} mute_config + * @returns {string} Resource name string. + */ + projectMuteConfigPath(project: string, muteConfig: string) { + return this.pathTemplates.projectMuteConfigPathTemplate.render({ + project: project, + mute_config: muteConfig, + }); + } + + /** + * Parse the project from ProjectMuteConfig resource. + * + * @param {string} projectMuteConfigName + * A fully-qualified path representing project_mute_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMuteConfigName(projectMuteConfigName: string) { + return this.pathTemplates.projectMuteConfigPathTemplate.match( + projectMuteConfigName + ).project; + } + + /** + * Parse the mute_config from ProjectMuteConfig resource. + * + * @param {string} projectMuteConfigName + * A fully-qualified path representing project_mute_config resource. + * @returns {string} A string representing the mute_config. + */ + matchMuteConfigFromProjectMuteConfigName(projectMuteConfigName: string) { + return this.pathTemplates.projectMuteConfigPathTemplate.match( + projectMuteConfigName + ).mute_config; + } + + /** + * Return a fully-qualified projectNotificationConfig resource name string. + * + * @param {string} project + * @param {string} notification_config + * @returns {string} Resource name string. + */ + projectNotificationConfigPath(project: string, notificationConfig: string) { + return this.pathTemplates.projectNotificationConfigPathTemplate.render({ + project: project, + notification_config: notificationConfig, + }); + } + + /** + * Parse the project from ProjectNotificationConfig resource. + * + * @param {string} projectNotificationConfigName + * A fully-qualified path representing project_notification_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectNotificationConfigName( + projectNotificationConfigName: string + ) { + return this.pathTemplates.projectNotificationConfigPathTemplate.match( + projectNotificationConfigName + ).project; + } + + /** + * Parse the notification_config from ProjectNotificationConfig resource. + * + * @param {string} projectNotificationConfigName + * A fully-qualified path representing project_notification_config resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromProjectNotificationConfigName( + projectNotificationConfigName: string + ) { + return this.pathTemplates.projectNotificationConfigPathTemplate.match( + projectNotificationConfigName + ).notification_config; + } + + /** + * Return a fully-qualified projectSource resource name string. + * + * @param {string} project + * @param {string} source + * @returns {string} Resource name string. + */ + projectSourcePath(project: string, source: string) { + return this.pathTemplates.projectSourcePathTemplate.render({ + project: project, + source: source, + }); + } + + /** + * Parse the project from ProjectSource resource. + * + * @param {string} projectSourceName + * A fully-qualified path representing project_source resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceName(projectSourceName: string) { + return this.pathTemplates.projectSourcePathTemplate.match(projectSourceName) + .project; + } + + /** + * Parse the source from ProjectSource resource. + * + * @param {string} projectSourceName + * A fully-qualified path representing project_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceName(projectSourceName: string) { + return this.pathTemplates.projectSourcePathTemplate.match(projectSourceName) + .source; + } + + /** + * Return a fully-qualified projectSourceFinding resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceFindingPath(project: string, source: string, finding: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.render({ + project: project, + source: source, + finding: finding, + }); + } + + /** + * Parse the project from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).project; + } + + /** + * Parse the source from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).source; + } + + /** + * Parse the finding from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified projectSourceFindingExternalsystem resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @param {string} externalsystem + * @returns {string} Resource name string. + */ + projectSourceFindingExternalsystemPath( + project: string, + source: string, + finding: string, + externalsystem: string + ) { + return this.pathTemplates.projectSourceFindingExternalsystemPathTemplate.render( + { + project: project, + source: source, + finding: finding, + externalsystem: externalsystem, + } + ); + } + + /** + * Parse the project from ProjectSourceFindingExternalsystem resource. + * + * @param {string} projectSourceFindingExternalsystemName + * A fully-qualified path representing project_source_finding_externalsystem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingExternalsystemName( + projectSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.projectSourceFindingExternalsystemPathTemplate.match( + projectSourceFindingExternalsystemName + ).project; + } + + /** + * Parse the source from ProjectSourceFindingExternalsystem resource. + * + * @param {string} projectSourceFindingExternalsystemName + * A fully-qualified path representing project_source_finding_externalsystem resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceFindingExternalsystemName( + projectSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.projectSourceFindingExternalsystemPathTemplate.match( + projectSourceFindingExternalsystemName + ).source; + } + + /** + * Parse the finding from ProjectSourceFindingExternalsystem resource. + * + * @param {string} projectSourceFindingExternalsystemName + * A fully-qualified path representing project_source_finding_externalsystem resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingExternalsystemName( + projectSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.projectSourceFindingExternalsystemPathTemplate.match( + projectSourceFindingExternalsystemName + ).finding; + } + + /** + * Parse the externalsystem from ProjectSourceFindingExternalsystem resource. + * + * @param {string} projectSourceFindingExternalsystemName + * A fully-qualified path representing project_source_finding_externalsystem resource. + * @returns {string} A string representing the externalsystem. + */ + matchExternalsystemFromProjectSourceFindingExternalsystemName( + projectSourceFindingExternalsystemName: string + ) { + return this.pathTemplates.projectSourceFindingExternalsystemPathTemplate.match( + projectSourceFindingExternalsystemName + ).externalsystem; + } + + /** + * Return a fully-qualified projectSourceFindingSecurityMarks resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceFindingSecurityMarksPath( + project: string, + source: string, + finding: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.render( + { + project: project, + source: source, + finding: finding, + } + ); + } + + /** + * Parse the project from ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).project; + } + + /** + * Parse the source from ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).source; + } + + /** + * Parse the finding from ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).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.securityCenterStub && !this._terminated) { + return this.securityCenterStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json new file mode 100644 index 00000000000..149e8338b1e --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client_config.json @@ -0,0 +1,193 @@ +{ + "interfaces": { + "google.cloud.securitycenter.v1.SecurityCenter": { + "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": { + "BulkMuteFindings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBigQueryExport": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetOrganizationSettings": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetSource": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupAssets": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupFindings": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAssets": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindings": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListMuteConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNotificationConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListSources": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RunAssetDiscovery": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetFindingState": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMute": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateExternalSystem": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateFinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMuteConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateOrganizationSettings": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSecurityMarks": { + "timeout_millis": 480000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBigQueryExport": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBigQueryExport": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBigQueryExport": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBigQueryExports": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json new file mode 100644 index 00000000000..be5b8aeaa29 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -0,0 +1,31 @@ +[ + "../../protos/google/cloud/securitycenter/v1/access.proto", + "../../protos/google/cloud/securitycenter/v1/asset.proto", + "../../protos/google/cloud/securitycenter/v1/bigquery_export.proto", + "../../protos/google/cloud/securitycenter/v1/compliance.proto", + "../../protos/google/cloud/securitycenter/v1/connection.proto", + "../../protos/google/cloud/securitycenter/v1/contact_details.proto", + "../../protos/google/cloud/securitycenter/v1/container.proto", + "../../protos/google/cloud/securitycenter/v1/database.proto", + "../../protos/google/cloud/securitycenter/v1/exfiltration.proto", + "../../protos/google/cloud/securitycenter/v1/external_system.proto", + "../../protos/google/cloud/securitycenter/v1/file.proto", + "../../protos/google/cloud/securitycenter/v1/finding.proto", + "../../protos/google/cloud/securitycenter/v1/folder.proto", + "../../protos/google/cloud/securitycenter/v1/iam_binding.proto", + "../../protos/google/cloud/securitycenter/v1/indicator.proto", + "../../protos/google/cloud/securitycenter/v1/kubernetes.proto", + "../../protos/google/cloud/securitycenter/v1/label.proto", + "../../protos/google/cloud/securitycenter/v1/mitre_attack.proto", + "../../protos/google/cloud/securitycenter/v1/mute_config.proto", + "../../protos/google/cloud/securitycenter/v1/notification_config.proto", + "../../protos/google/cloud/securitycenter/v1/notification_message.proto", + "../../protos/google/cloud/securitycenter/v1/organization_settings.proto", + "../../protos/google/cloud/securitycenter/v1/process.proto", + "../../protos/google/cloud/securitycenter/v1/resource.proto", + "../../protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto", + "../../protos/google/cloud/securitycenter/v1/security_marks.proto", + "../../protos/google/cloud/securitycenter/v1/securitycenter_service.proto", + "../../protos/google/cloud/securitycenter/v1/source.proto", + "../../protos/google/cloud/securitycenter/v1/vulnerability.proto" +] diff --git a/packages/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json b/packages/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..02da4303dc4 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/gapic_metadata.json @@ -0,0 +1,223 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.securitycenter.v1beta1", + "libraryPackage": "@google-cloud/security-center", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-securitycenter/src/v1beta1/index.ts b/packages/google-cloud-securitycenter/src/v1beta1/index.ts new file mode 100644 index 00000000000..d7817680667 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/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 {SecurityCenterClient} from './security_center_client'; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts new file mode 100644 index 00000000000..48a71d22b29 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -0,0 +1,3761 @@ +// 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, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/security_center_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './security_center_client_config.json'; +const version = require('../../../package.json').version; + +/** + * V1 Beta APIs for Security Center service. + * @class + * @memberof v1beta1 + */ +export class SecurityCenterClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + securityCenterStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SecurityCenterClient. + * + * @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 SecurityCenterClient({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 SecurityCenterClient; + 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 = { + assetPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}' + ), + findingPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + organizationAssetSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' + ), + organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/organizationSettings' + ), + organizationSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), + sourcePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}' + ), + }; + + // 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 = { + groupAssets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groupByResults' + ), + groupFindings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groupByResults' + ), + listAssets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'listAssetsResults' + ), + listFindings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'findings' + ), + listSources: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'sources' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1beta1/{name=organizations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta1/{name=organizations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta1/{name=organizations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta1/{name=organizations/*/operations}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const runAssetDiscoveryResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const runAssetDiscoveryMetadata = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + runAssetDiscovery: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), + runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.securitycenter.v1beta1.SecurityCenter', + 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.securityCenterStub) { + return this.securityCenterStub; + } + + // Put together the "service stub" for + // google.cloud.securitycenter.v1beta1.SecurityCenter. + this.securityCenterStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.securitycenter.v1beta1.SecurityCenter' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.securitycenter.v1beta1 + .SecurityCenter, + 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 securityCenterStubMethods = [ + 'createSource', + 'createFinding', + 'getIamPolicy', + 'getOrganizationSettings', + 'getSource', + 'groupAssets', + 'groupFindings', + 'listAssets', + 'listFindings', + 'listSources', + 'runAssetDiscovery', + 'setFindingState', + 'setIamPolicy', + 'testIamPermissions', + 'updateFinding', + 'updateOrganizationSettings', + 'updateSource', + 'updateSecurityMarks', + ]; + for (const methodName of securityCenterStubMethods) { + const callPromise = this.securityCenterStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.securityCenterStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'securitycenter.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 'securitycenter.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 source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * @param {google.cloud.securitycenter.v1beta1.Source} request.source + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * 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/v1beta1/security_center.create_source.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_CreateSource_async + */ + createSource( + request?: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ISource, + ( + | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | undefined + ), + {} | undefined + ] + >; + createSource( + request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createSource( + request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createSource( + request?: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ISource, + ( + | protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createSource(request, options, callback); + } + /** + * Creates a finding. The corresponding source must exist for finding creation + * to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * @param {string} request.findingId + * Required. Unique identifier provided by the client within the parent scope. + * It must be alphanumeric and less than or equal to 32 characters and + * greater than 0 characters in length. + * @param {google.cloud.securitycenter.v1beta1.Finding} request.finding + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1beta1.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/v1beta1/security_center.create_finding.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_CreateFinding_async + */ + createFinding( + request?: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IFinding, + ( + | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | undefined + ), + {} | undefined + ] + >; + createFinding( + request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createFinding( + request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createFinding( + request?: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IFinding, + ( + | protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createFinding(request, options, callback); + } + /** + * Gets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * 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/v1beta1/security_center.get_iam_policy.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + /** + * Gets the settings for an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. + * 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/v1beta1/security_center.get_organization_settings.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_GetOrganizationSettings_async + */ + getOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + ( + | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + >; + getOrganizationSettings( + request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOrganizationSettings( + request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + ( + | protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getOrganizationSettings( + request, + options, + callback + ); + } + /** + * Gets a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * 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/v1beta1/security_center.get_source.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_GetSource_async + */ + getSource( + request?: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest | undefined, + {} | undefined + ] + >; + getSource( + request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSource( + request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSource( + request?: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ISource, + protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getSource(request, options, callback); + } + /** + * Updates the state of a finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * @param {google.cloud.securitycenter.v1beta1.Finding.State} request.state + * Required. The desired State of the finding. + * @param {google.protobuf.Timestamp} request.startTime + * Required. The time at which the updated state takes effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.securitycenter.v1beta1.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/v1beta1/security_center.set_finding_state.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_SetFindingState_async + */ + setFindingState( + request?: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IFinding, + ( + | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | undefined + ), + {} | undefined + ] + >; + setFindingState( + request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setFindingState( + request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setFindingState( + request?: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IFinding, + ( + | protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.setFindingState(request, options, callback); + } + /** + * Sets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * 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/v1beta1/security_center.set_iam_policy.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + /** + * Returns the permissions that a caller has on the specified source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * 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/v1beta1/security_center.test_iam_permissions.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + /** + * Creates or updates a finding. The corresponding source must exist for a + * finding creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1beta1.Finding} request.finding + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * + * In the case of creation, the finding id portion of the name must + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.securitycenter.v1beta1.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/v1beta1/security_center.update_finding.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_UpdateFinding_async + */ + updateFinding( + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IFinding, + ( + | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | undefined + ), + {} | undefined + ] + >; + updateFinding( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateFinding( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateFinding( + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.IFinding, + | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IFinding, + ( + | protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'finding.name': request.finding!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateFinding(request, options, callback); + } + /** + * Updates an organization's settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1beta1.OrganizationSettings} request.organizationSettings + * Required. The organization settings resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the settings resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1beta1.OrganizationSettings}. + * 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/v1beta1/security_center.update_organization_settings.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async + */ + updateOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + ( + | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + >; + updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, + ( + | protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateOrganizationSettings( + request, + options, + callback + ); + } + /** + * Updates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1beta1.Source} request.source + * Required. The source resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the source resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * 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/v1beta1/security_center.update_source.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_UpdateSource_async + */ + updateSource( + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ISource, + ( + | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | undefined + ), + {} | undefined + ] + >; + updateSource( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSource( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSource( + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.ISource, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ISource, + ( + | protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'source.name': request.source!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSource(request, options, callback); + } + /** + * Updates security marks. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1beta1.SecurityMarks} request.securityMarks + * Required. The security marks resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the security marks resource. + * @param {google.protobuf.Timestamp} request.startTime + * The time at which the updated SecurityMarks take effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1beta1.SecurityMarks}. + * 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/v1beta1/security_center.update_security_marks.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_UpdateSecurityMarks_async + */ + updateSecurityMarks( + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + ( + | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + >; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSecurityMarks( + request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, + ( + | protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSecurityMarks(request, options, callback); + } + + /** + * Runs asset discovery. The discovery is tracked with a long-running + * operation. + * + * This API can only be called with limited frequency for an organization. If + * it is called too frequently the caller will receive a TOO_MANY_REQUESTS + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async + */ + runAssetDiscovery( + request?: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + options?: CallOptions + ): Promise< + [ + LROperation, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runAssetDiscovery( + request?: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.runAssetDiscovery(request, options, callback); + } + /** + * Check the status of the long running operation returned by `runAssetDiscovery()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_RunAssetDiscovery_async + */ + async checkRunAssetDiscoveryProgress( + name: string + ): Promise< + LROperation + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.runAssetDiscovery, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.protobuf.Empty + >; + } + /** + * Filters an organization's assets and groups them by their specified + * properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the Asset's "state" property is updated to + * indicate whether the asset was added, removed, or remained present during + * the compare_duration period of time that precedes the read_time. This is + * the time between (read_time - compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * This field is ignored if `state` is not a field in `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. + * 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 `groupAssetsAsync()` + * 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. + */ + groupAssets( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + ] + >; + groupAssets( + request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + > + ): void; + groupAssets( + request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + > + ): void; + groupAssets( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.groupAssets(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. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the Asset's "state" property is updated to + * indicate whether the asset was added, removed, or remained present during + * the compare_duration period of time that precedes the read_time. This is + * the time between (read_time - compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * This field is ignored if `state` is not a field in `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} 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 `groupAssetsAsync()` + * 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. + */ + groupAssetsStream( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + 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['groupAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.groupAssets.createStream( + this.innerApiCalls.groupAssets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `groupAssets`, 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. Name of the organization to groupBy. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the Asset's "state" property is updated to + * indicate whether the asset was added, removed, or remained present during + * the compare_duration period of time that precedes the read_time. This is + * the time between (read_time - compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * This field is ignored if `state` is not a field in `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. 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/v1beta1/security_center.group_assets.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_GroupAssets_async + */ + groupAssetsAsync( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, + 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['groupAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.groupAssets.asyncIterate( + this.innerApiCalls['groupAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Filters an organization or source's findings and groups them by their + * specified properties. + * + * To group across all sources provide a `-` as the source id. + * Example: /v1beta1/organizations/{organization_id}/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping (including + * `state`). The string value should follow SQL syntax: comma separated list + * of fields. For example: + * "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. + * 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 `groupFindingsAsync()` + * 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. + */ + groupFindings( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + ] + >; + groupFindings( + request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + > + ): void; + groupFindings( + request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + > + ): void; + groupFindings( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IGroupResult + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.groupFindings(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. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping (including + * `state`). The string value should follow SQL syntax: comma separated list + * of fields. For example: + * "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult} 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 `groupFindingsAsync()` + * 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. + */ + groupFindingsStream( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + 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['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.groupFindings.createStream( + this.innerApiCalls.groupFindings as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `groupFindings`, 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. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across + * all sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping (including + * `state`). The string value should follow SQL syntax: comma separated list + * of fields. For example: + * "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [GroupResult]{@link google.cloud.securitycenter.v1beta1.GroupResult}. 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/v1beta1/security_center.group_findings.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_GroupFindings_async + */ + groupFindingsAsync( + request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, + 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['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.groupFindings.asyncIterate( + this.innerApiCalls['groupFindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists an organization's assets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetResult's "state" attribute is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - + * compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state is + * "UNUSED", which indicates that the asset is present at read_time. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult}. + * 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 `listAssetsAsync()` + * 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. + */ + listAssets( + request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + ] + >; + listAssets( + request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult + > + ): void; + listAssets( + request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult + > + ): void; + listAssets( + request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listAssets(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. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetResult's "state" attribute is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - + * compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state is + * "UNUSED", which indicates that the asset is present at read_time. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} 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 `listAssetsAsync()` + * 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. + */ + listAssetsStream( + request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + 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['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssets.createStream( + this.innerApiCalls.listAssets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAssets`, 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. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `resource_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetResult's "state" attribute is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - + * compare_duration) and read_time. + * + * The state value is derived based on the presence of the asset at the two + * points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present before + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state is + * "UNUSED", which indicates that the asset is present at read_time. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [ListAssetsResult]{@link google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult}. 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/v1beta1/security_center.list_assets.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_ListAssets_async + */ + listAssetsAsync( + request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, + 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['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists an organization or source's findings. + * + * To list across all sources provide a `-` as the source id. + * Example: /v1beta1/organizations/{organization_id}/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.securitycenter.v1beta1.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.securitycenter.v1beta1.IListFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IFinding[], + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + ] + >; + listFindings( + request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IFinding + > + ): void; + listFindings( + request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IFinding + > + ): void; + listFindings( + request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IFinding + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.IFinding + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.IFinding[], + protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1beta1.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. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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.securitycenter.v1beta1.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.securitycenter.v1beta1.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. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id]". To list across all + * sources provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are not supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * For example, `source_properties.size = 100` is a valid filter string. + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.FieldMask} [request.fieldMask] + * Optional. A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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.securitycenter.v1beta1.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/v1beta1/security_center.list_findings.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_ListFindings_async + */ + listFindingsAsync( + request?: protos.google.cloud.securitycenter.v1beta1.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; + } + /** + * Lists all sources belonging to an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Source]{@link google.cloud.securitycenter.v1beta1.Source}. + * 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 `listSourcesAsync()` + * 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. + */ + listSources( + request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ISource[], + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, + protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse + ] + >; + listSources( + request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ISource + > + ): void; + listSources( + request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ISource + > + ): void; + listSources( + request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ISource + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1beta1.ISource + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1beta1.ISource[], + protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, + protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listSources(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [Source]{@link google.cloud.securitycenter.v1beta1.Source} 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 `listSourcesAsync()` + * 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. + */ + listSourcesStream( + request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + 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['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSources.createStream( + this.innerApiCalls.listSources as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSources`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [Source]{@link google.cloud.securitycenter.v1beta1.Source}. 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/v1beta1/security_center.list_sources.js + * region_tag:securitycenter_v1beta1_generated_SecurityCenter_ListSources_async + */ + listSourcesAsync( + request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, + 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['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSources.asyncIterate( + this.innerApiCalls['listSources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified asset resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + assetPath(organization: string, asset: string) { + return this.pathTemplates.assetPathTemplate.render({ + organization: organization, + asset: asset, + }); + } + + /** + * Parse the organization from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).organization; + } + + /** + * Parse the asset from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).asset; + } + + /** + * Return a fully-qualified finding resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + findingPath(organization: string, source: string, finding: string) { + return this.pathTemplates.findingPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Parse the organization from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName) + .organization; + } + + /** + * Parse the source from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName).source; + } + + /** + * 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 organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Return a fully-qualified organizationAssetSecurityMarks resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetSecurityMarksPath(organization: string, asset: string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render( + { + organization: organization, + asset: asset, + } + ); + } + + /** + * Parse the organization from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetSecurityMarksName( + organizationAssetSecurityMarksName: string + ) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + organizationAssetSecurityMarksName + ).organization; + } + + /** + * Parse the asset from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetSecurityMarksName( + organizationAssetSecurityMarksName: string + ) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + organizationAssetSecurityMarksName + ).asset; + } + + /** + * Return a fully-qualified organizationSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationSettingsPath(organization: string) { + return this.pathTemplates.organizationSettingsPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from OrganizationSettings resource. + * + * @param {string} organizationSettingsName + * A fully-qualified path representing OrganizationSettings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSettingsName( + organizationSettingsName: string + ) { + return this.pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName + ).organization; + } + + /** + * Return a fully-qualified organizationSourceFindingSecurityMarks resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingSecurityMarksPath( + organization: string, + source: string, + finding: string + ) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render( + { + organization: organization, + source: source, + finding: finding, + } + ); + } + + /** + * Parse the organization from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName + ).finding; + } + + /** + * Return a fully-qualified source resource name string. + * + * @param {string} organization + * @param {string} source + * @returns {string} Resource name string. + */ + sourcePath(organization: string, source: string) { + return this.pathTemplates.sourcePathTemplate.render({ + organization: organization, + source: source, + }); + } + + /** + * Parse the organization from Source resource. + * + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromSourceName(sourceName: string) { + return this.pathTemplates.sourcePathTemplate.match(sourceName).organization; + } + + /** + * Parse the source from Source resource. + * + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromSourceName(sourceName: string) { + return this.pathTemplates.sourcePathTemplate.match(sourceName).source; + } + + /** + * 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.securityCenterStub && !this._terminated) { + return this.securityCenterStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json new file mode 100644 index 00000000000..a1a7e2d9386 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client_config.json @@ -0,0 +1,116 @@ +{ + "interfaces": { + "google.cloud.securitycenter.v1beta1.SecurityCenter": { + "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": { + "CreateSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetOrganizationSettings": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetSource": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupAssets": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupFindings": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAssets": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindings": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListSources": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RunAssetDiscovery": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetFindingState": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateFinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateOrganizationSettings": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSecurityMarks": { + "timeout_millis": 480000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json new file mode 100644 index 00000000000..d10dce6c60d --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/securitycenter/v1beta1/asset.proto", + "../../protos/google/cloud/securitycenter/v1beta1/finding.proto", + "../../protos/google/cloud/securitycenter/v1beta1/organization_settings.proto", + "../../protos/google/cloud/securitycenter/v1beta1/run_asset_discovery_response.proto", + "../../protos/google/cloud/securitycenter/v1beta1/security_marks.proto", + "../../protos/google/cloud/securitycenter/v1beta1/securitycenter_service.proto", + "../../protos/google/cloud/securitycenter/v1beta1/source.proto" +] diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json b/packages/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json new file mode 100644 index 00000000000..c0d8ccc6990 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/gapic_metadata.json @@ -0,0 +1,277 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.securitycenter.v1p1beta1", + "libraryPackage": "@google-cloud/security-center", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "createNotificationConfig" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "deleteNotificationConfig" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetNotificationConfig": { + "methods": [ + "getNotificationConfig" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "updateNotificationConfig" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "listNotificationConfigs", + "listNotificationConfigsStream", + "listNotificationConfigsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SecurityCenterClient", + "rpcs": { + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "CreateFinding": { + "methods": [ + "createFinding" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "createNotificationConfig" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "deleteNotificationConfig" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetNotificationConfig": { + "methods": [ + "getNotificationConfig" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "getOrganizationSettings" + ] + }, + "GetSource": { + "methods": [ + "getSource" + ] + }, + "SetFindingState": { + "methods": [ + "setFindingState" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateFinding": { + "methods": [ + "updateFinding" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "updateNotificationConfig" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "updateOrganizationSettings" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "updateSecurityMarks" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "runAssetDiscovery" + ] + }, + "GroupAssets": { + "methods": [ + "groupAssets", + "groupAssetsStream", + "groupAssetsAsync" + ] + }, + "GroupFindings": { + "methods": [ + "groupFindings", + "groupFindingsStream", + "groupFindingsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "listNotificationConfigs", + "listNotificationConfigsStream", + "listNotificationConfigsAsync" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/index.ts new file mode 100644 index 00000000000..d7817680667 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/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 {SecurityCenterClient} from './security_center_client'; diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts new file mode 100644 index 00000000000..620cd4cb7ef --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -0,0 +1,5707 @@ +// 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, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1p1beta1/security_center_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './security_center_client_config.json'; +const version = require('../../../package.json').version; + +/** + * V1p1Beta1 APIs for Security Center service. + * @class + * @memberof v1p1beta1 + */ +export class SecurityCenterClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + securityCenterStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SecurityCenterClient. + * + * @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 SecurityCenterClient({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 SecurityCenterClient; + 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 = { + folderAssetPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}' + ), + folderAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/assets/{asset}/securityMarks' + ), + folderSourcePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}' + ), + folderSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}' + ), + folderSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/sources/{source}/findings/{finding}/securityMarks' + ), + notificationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/notificationConfigs/{notification_config}' + ), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + organizationAssetPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}' + ), + organizationAssetSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/assets/{asset}/securityMarks' + ), + organizationSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/organizationSettings' + ), + organizationSourcePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}' + ), + organizationSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}' + ), + organizationSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/sources/{source}/findings/{finding}/securityMarks' + ), + projectAssetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assets/{asset}' + ), + projectAssetSecurityMarksPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assets/{asset}/securityMarks' + ), + projectSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}' + ), + projectSourceFindingPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}' + ), + projectSourceFindingSecurityMarksPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/sources/{source}/findings/{finding}/securityMarks' + ), + }; + + // 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 = { + groupAssets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groupByResults' + ), + groupFindings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groupByResults' + ), + listAssets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'listAssetsResults' + ), + listFindings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'listFindingsResults' + ), + listNotificationConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'notificationConfigs' + ), + listSources: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'sources' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1p1beta1/{name=organizations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1p1beta1/{name=organizations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1p1beta1/{name=organizations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1p1beta1/{name=organizations/*/operations}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const runAssetDiscoveryResponse = protoFilesRoot.lookup( + '.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse' + ) as gax.protobuf.Type; + const runAssetDiscoveryMetadata = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + runAssetDiscovery: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runAssetDiscoveryResponse.decode.bind(runAssetDiscoveryResponse), + runAssetDiscoveryMetadata.decode.bind(runAssetDiscoveryMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.securitycenter.v1p1beta1.SecurityCenter', + 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.securityCenterStub) { + return this.securityCenterStub; + } + + // Put together the "service stub" for + // google.cloud.securitycenter.v1p1beta1.SecurityCenter. + this.securityCenterStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.securitycenter.v1p1beta1.SecurityCenter' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.securitycenter.v1p1beta1 + .SecurityCenter, + 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 securityCenterStubMethods = [ + 'createSource', + 'createFinding', + 'createNotificationConfig', + 'deleteNotificationConfig', + 'getIamPolicy', + 'getNotificationConfig', + 'getOrganizationSettings', + 'getSource', + 'groupAssets', + 'groupFindings', + 'listAssets', + 'listFindings', + 'listNotificationConfigs', + 'listSources', + 'runAssetDiscovery', + 'setFindingState', + 'setIamPolicy', + 'testIamPermissions', + 'updateFinding', + 'updateNotificationConfig', + 'updateOrganizationSettings', + 'updateSource', + 'updateSecurityMarks', + ]; + for (const methodName of securityCenterStubMethods) { + const callPromise = this.securityCenterStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.securityCenterStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'securitycenter.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 'securitycenter.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 source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * @param {google.cloud.securitycenter.v1p1beta1.Source} request.source + * Required. The Source being created, only the display_name and description will be + * used. All other fields will be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. + * 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/v1p1beta1/security_center.create_source.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_async + */ + createSource( + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + ( + | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | undefined + ), + {} | undefined + ] + >; + createSource( + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createSource( + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createSource( + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + ( + | protos.google.cloud.securitycenter.v1p1beta1.ICreateSourceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createSource(request, options, callback); + } + /** + * Creates a finding. The corresponding source must exist for finding + * creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * @param {string} request.findingId + * Required. Unique identifier provided by the client within the parent scope. + * @param {google.cloud.securitycenter.v1p1beta1.Finding} request.finding + * Required. The Finding being created. The name and security_marks will be ignored as + * they are both output only fields on this resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.securitycenter.v1p1beta1.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/v1p1beta1/security_center.create_finding.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_async + */ + createFinding( + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + ( + | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | undefined + ), + {} | undefined + ] + >; + createFinding( + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createFinding( + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createFinding( + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + ( + | protos.google.cloud.securitycenter.v1p1beta1.ICreateFindingRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createFinding(request, options, callback); + } + /** + * Creates a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the new notification config's parent. Its format is + * "organizations/[organization_id]". + * @param {string} request.configId + * Required. Unique identifier provided by the client within the parent scope. + * It must be between 1 and 128 characters, and contains alphanumeric + * characters, underscores or hyphens only. + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} request.notificationConfig + * Required. The notification config being created. The name and the service account + * will be ignored as they are both output only fields on this resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. + * 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/v1p1beta1/security_center.create_notification_config.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_async + */ + createNotificationConfig( + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + ( + | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + createNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createNotificationConfig( + request?: protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + ( + | protos.google.cloud.securitycenter.v1p1beta1.ICreateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createNotificationConfig( + request, + options, + callback + ); + } + /** + * Deletes a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the notification config to delete. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [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/v1p1beta1/security_center.delete_notification_config.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_async + */ + deleteNotificationConfig( + request?: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteNotificationConfig( + request?: protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IDeleteNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.deleteNotificationConfig( + request, + options, + callback + ); + } + /** + * Gets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * 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/v1p1beta1/security_center.get_iam_policy.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + /** + * Gets a notification config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the notification config to get. Its format is + * "organizations/[organization_id]/notificationConfigs/[config_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. + * 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/v1p1beta1/security_center.get_notification_config.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_async + */ + getNotificationConfig( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + getNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getNotificationConfig( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IGetNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getNotificationConfig(request, options, callback); + } + /** + * Gets the settings for an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings}. + * 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/v1p1beta1/security_center.get_organization_settings.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_async + */ + getOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + >; + getOrganizationSettings( + request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOrganizationSettings( + request: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IGetOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getOrganizationSettings( + request, + options, + callback + ); + } + /** + * Gets a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. + * 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/v1p1beta1/security_center.get_source.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_async + */ + getSource( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | undefined + ), + {} | undefined + ] + >; + getSource( + request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSource( + request: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSource( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IGetSourceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getSource(request, options, callback); + } + /** + * Updates the state of a finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name + * Example: + * "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * @param {google.cloud.securitycenter.v1p1beta1.Finding.State} request.state + * Required. The desired State of the finding. + * @param {google.protobuf.Timestamp} request.startTime + * Required. The time at which the updated state takes effect. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.securitycenter.v1p1beta1.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/v1p1beta1/security_center.set_finding_state.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_async + */ + setFindingState( + request?: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + ( + | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | undefined + ), + {} | undefined + ] + >; + setFindingState( + request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setFindingState( + request: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setFindingState( + request?: protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + ( + | protos.google.cloud.securitycenter.v1p1beta1.ISetFindingStateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.setFindingState(request, options, callback); + } + /** + * Sets the access control policy on the specified Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * 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/v1p1beta1/security_center.set_iam_policy.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + /** + * Returns the permissions that a caller has on the specified source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * 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/v1p1beta1/security_center.test_iam_permissions.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + /** + * Creates or updates a finding. The corresponding source must exist for a + * finding creation to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.Finding} request.finding + * Required. The finding resource to update or create if it does not already exist. + * parent, security_marks, and update_time will be ignored. + * + * In the case of creation, the finding id portion of the name must be + * alphanumeric and less than or equal to 32 characters and greater than 0 + * characters in length. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the finding resource. This field should + * not be specified when creating a finding. + * + * When updating a finding, an empty mask is treated as updating all mutable + * fields and replacing source_properties. Individual source_properties can + * be added/updated by using "source_properties." in the field + * mask. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.securitycenter.v1p1beta1.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/v1p1beta1/security_center.update_finding.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_async + */ + updateFinding( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | undefined + ), + {} | undefined + ] + >; + updateFinding( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateFinding( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateFinding( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IFinding, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateFindingRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'finding.name': request.finding!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateFinding(request, options, callback); + } + /** + * Updates a notification config. The following update + * fields are allowed: description, pubsub_topic, streaming_config.filter + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.NotificationConfig} request.notificationConfig + * Required. The notification config to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the notification config. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. + * 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/v1p1beta1/security_center.update_notification_config.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_async + */ + updateNotificationConfig( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateNotificationConfig( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateNotificationConfig( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateNotificationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'notification_config.name': request.notificationConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateNotificationConfig( + request, + options, + callback + ); + } + /** + * Updates an organization's settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.OrganizationSettings} request.organizationSettings + * Required. The organization settings resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the settings resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [OrganizationSettings]{@link google.cloud.securitycenter.v1p1beta1.OrganizationSettings}. + * 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/v1p1beta1/security_center.update_organization_settings.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_async + */ + updateOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + >; + updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateOrganizationSettings( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateOrganizationSettings( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateOrganizationSettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'organization_settings.name': request.organizationSettings!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateOrganizationSettings( + request, + options, + callback + ); + } + /** + * Updates a source. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.Source} request.source + * Required. The source resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the source resource. + * + * If empty all mutable fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. + * 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/v1p1beta1/security_center.update_source.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_async + */ + updateSource( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | undefined + ), + {} | undefined + ] + >; + updateSource( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSource( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSource( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISource, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ISource, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSourceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'source.name': request.source!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSource(request, options, callback); + } + /** + * Updates security marks. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.securitycenter.v1p1beta1.SecurityMarks} request.securityMarks + * Required. The security marks resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The FieldMask to use when updating the security marks resource. + * + * The field mask must not contain duplicate fields. + * If empty or set to "marks", all marks will be replaced. Individual + * marks can be updated using "marks.". + * @param {google.protobuf.Timestamp} request.startTime + * The time at which the updated SecurityMarks take effect. + * If not set uses current server time. Updates will be applied to the + * SecurityMarks that are active immediately preceding this time. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityMarks]{@link google.cloud.securitycenter.v1p1beta1.SecurityMarks}. + * 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/v1p1beta1/security_center.update_security_marks.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_async + */ + updateSecurityMarks( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + >; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSecurityMarks( + request: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + callback: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSecurityMarks( + request?: protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks, + ( + | protos.google.cloud.securitycenter.v1p1beta1.IUpdateSecurityMarksRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'security_marks.name': request.securityMarks!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSecurityMarks(request, options, callback); + } + + /** + * Runs asset discovery. The discovery is tracked with a long-running + * operation. + * + * This API can only be called with limited frequency for an organization. If + * it is called too frequently the caller will receive a TOO_MANY_REQUESTS + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async + */ + runAssetDiscovery( + request?: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runAssetDiscovery( + request: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + callback: Callback< + LROperation< + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runAssetDiscovery( + request?: protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.runAssetDiscovery(request, options, callback); + } + /** + * Check the status of the long running operation returned by `runAssetDiscovery()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/security_center.run_asset_discovery.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_async + */ + async checkRunAssetDiscoveryProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse, + protos.google.protobuf.Empty + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.runAssetDiscovery, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse, + protos.google.protobuf.Empty + >; + } + /** + * Filters an organization's assets and groups them by their specified + * properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to groupBy. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_name_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult}. + * 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 `groupAssetsAsync()` + * 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. + */ + groupAssets( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + ] + >; + groupAssets( + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + > + ): void; + groupAssets( + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + > + ): void; + groupAssets( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.groupAssets(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. Name of the organization to groupBy. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_name_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult} 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 `groupAssetsAsync()` + * 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. + */ + groupAssetsStream( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + 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['groupAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.groupAssets.createStream( + this.innerApiCalls.groupAssets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `groupAssets`, 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. Name of the organization to groupBy. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_name_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping. The string + * value should follow SQL syntax: comma separated list of fields. For + * example: + * "security_center_properties.resource_project,security_center_properties.project". + * + * The following fields are supported when compare_duration is not set: + * + * * security_center_properties.resource_project + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_type + * * security_center_properties.resource_parent + * * security_center_properties.resource_parent_display_name + * + * The following fields are supported when compare_duration is set: + * + * * security_center_properties.resource_type + * * security_center_properties.resource_project_display_name + * * security_center_properties.resource_parent_display_name + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" property is + * updated to indicate whether the asset was added, removed, or remained + * present during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at reference_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at reference_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and reference_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {string} request.pageToken + * The value returned by the last `GroupAssetsResponse`; indicates + * that this is a continuation of a prior `GroupAssets` call, and that the + * system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult}. 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/v1p1beta1/security_center.group_assets.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_async + */ + groupAssetsAsync( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupAssetsRequest, + 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['groupAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.groupAssets.asyncIterate( + this.innerApiCalls['groupAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Filters an organization or source's findings and groups them by their + * specified properties. + * + * To group across all sources provide a `-` as the source id. + * Example: /v1/organizations/{organization_id}/sources/-/findings, + * /v1/folders/{folder_id}/sources/-/findings, + * /v1/projects/{project_id}/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * * severity + * + * The following fields are supported when compare_duration is set: + * + * * state_change + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult}. + * 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 `groupFindingsAsync()` + * 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. + */ + groupFindings( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + ] + >; + groupFindings( + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + > + ): void; + groupFindings( + request: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + > + ): void; + groupFindings( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[], + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.groupFindings(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. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * * severity + * + * The following fields are supported when compare_duration is set: + * + * * state_change + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult} 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 `groupFindingsAsync()` + * 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. + */ + groupFindingsStream( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + 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['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.groupFindings.createStream( + this.innerApiCalls.groupFindings as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `groupFindings`, 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. Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]", + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]. To groupBy across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, + * or projects/{project_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * + * * security_marks.marks: `=`, `:` + * * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * @param {string} request.groupBy + * Required. Expression that defines what assets fields to use for grouping (including + * `state_change`). The string value should follow SQL syntax: comma separated + * list of fields. For example: "parent,resource_name". + * + * The following fields are supported: + * + * * resource_name + * * category + * * state + * * parent + * * severity + * + * The following fields are supported when compare_duration is set: + * + * * state_change + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the GroupResult's "state_change" attribute is + * updated to indicate whether the finding had its state changed, the + * finding's state remained unchanged, or if the finding was added during the + * compare_duration period of time that precedes the read_time. This is the + * time between (read_time - compare_duration) and read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present + * at read_time. + * + * If this field is set then `state_change` must be a specified field in + * `group_by`. + * @param {string} request.pageToken + * The value returned by the last `GroupFindingsResponse`; indicates + * that this is a continuation of a prior `GroupFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [GroupResult]{@link google.cloud.securitycenter.v1p1beta1.GroupResult}. 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/v1p1beta1/security_center.group_findings.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_async + */ + groupFindingsAsync( + request?: protos.google.cloud.securitycenter.v1p1beta1.IGroupFindingsRequest, + 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['groupFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.groupFindings.asyncIterate( + this.innerApiCalls['groupFindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists an organization's assets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following are the allowed field and operator combinations: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [ListAssetsResult]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult}. + * 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 `listAssetsAsync()` + * 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. + */ + listAssets( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + ] + >; + listAssets( + request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult + > + ): void; + listAssets( + request: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult + > + ): void; + listAssets( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListAssetsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listAssets(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. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following are the allowed field and operator combinations: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [ListAssetsResult]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult} 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 `listAssetsAsync()` + * 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. + */ + listAssetsStream( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + 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['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssets.createStream( + this.innerApiCalls.listAssets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAssets`, 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. Name of the organization assets should belong to. Its format is + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.filter + * Expression that defines the filter to apply across assets. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. The fields map to those + * defined in the Asset resource. Examples include: + * + * * name + * * security_center_properties.resource_name + * * resource_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following are the allowed field and operator combinations: + * + * * name: `=` + * * update_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `update_time = "2019-06-10T16:07:18-07:00"` + * `update_time = 1560208038000` + * + * * create_time: `=`, `>`, `<`, `>=`, `<=` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `create_time = "2019-06-10T16:07:18-07:00"` + * `create_time = 1560208038000` + * + * * iam_policy.policy_blob: `=`, `:` + * * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * * security_marks.marks: `=`, `:` + * * security_center_properties.resource_name: `=`, `:` + * * security_center_properties.resource_display_name: `=`, `:` + * * security_center_properties.resource_type: `=`, `:` + * * security_center_properties.resource_parent: `=`, `:` + * * security_center_properties.resource_parent_display_name: `=`, `:` + * * security_center_properties.resource_project: `=`, `:` + * * security_center_properties.resource_project_display_name: `=`, `:` + * * security_center_properties.resource_owners: `=`, `:` + * + * For example, `resource_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `resource_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-resource_properties.my_property : ""` + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,resource_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,resource_properties.a_property" and " + * name desc , resource_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * update_time + * resource_properties + * security_marks.marks + * security_center_properties.resource_name + * security_center_properties.resource_display_name + * security_center_properties.resource_parent + * security_center_properties.resource_parent_display_name + * security_center_properties.resource_project + * security_center_properties.resource_project_display_name + * security_center_properties.resource_type + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering assets. The filter is limited + * to assets existing at the supplied time and their values are those at that + * specific time. Absence of this field will default to the API's version of + * NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListAssetsResult's "state_change" + * attribute is updated to indicate whether the asset was added, removed, or + * remained present during the compare_duration period of time that precedes + * the read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence of the asset at the + * two points in time. Intermediate state changes between the two times don't + * affect the result. For example, the results aren't affected if the asset is + * removed and re-created again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "ADDED": indicates that the asset was not present at the start of + * compare_duration, but present at read_time. + * * "REMOVED": indicates that the asset was present at the start of + * compare_duration, but not present at read_time. + * * "ACTIVE": indicates that the asset was present at both the + * start and the end of the time period defined by + * compare_duration and read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all assets present at + * read_time. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the ListAssetsResult fields to be listed in the + * response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListAssetsResponse`; indicates + * that this is a continuation of a prior `ListAssets` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [ListAssetsResult]{@link google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult}. 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/v1p1beta1/security_center.list_assets.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_async + */ + listAssetsAsync( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListAssetsRequest, + 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['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists an organization or source's findings. + * + * To list across all sources provide a `-` as the source id. + * Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * + * security_marks.marks: `=`, `:` + * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [ListFindingsResult]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult}. + * 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.securitycenter.v1p1beta1.IListFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + ] + >; + listFindings( + request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult + > + ): void; + listFindings( + request: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult + > + ): void; + listFindings( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[], + protos.google.cloud.securitycenter.v1p1beta1.IListFindingsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.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. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * + * security_marks.marks: `=`, `:` + * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [ListFindingsResult]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult} 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.securitycenter.v1p1beta1.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. Name of the source the findings belong to. Its format is + * "organizations/[organization_id]/sources/[source_id], + * folders/[folder_id]/sources/[source_id], or + * projects/[project_id]/sources/[source_id]". To list across all sources + * provide a source_id of `-`. For example: + * organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or + * projects/{projects_id}/sources/- + * @param {string} request.filter + * Expression that defines the filter to apply across findings. + * The expression is a list of one or more restrictions combined via logical + * operators `AND` and `OR`. + * Parentheses are supported, and `OR` has higher precedence than `AND`. + * + * Restrictions have the form ` ` and may have a `-` + * character in front of them to indicate negation. Examples include: + * + * * name + * * source_properties.a_property + * * security_marks.marks.marka + * + * The supported operators are: + * + * * `=` for all value types. + * * `>`, `<`, `>=`, `<=` for integer values. + * * `:`, meaning substring matching, for strings. + * + * The supported value types are: + * + * * string literals in quotes. + * * integer literals without quotes. + * * boolean literals `true` and `false` without quotes. + * + * The following field and operator combinations are supported: + * + * * name: `=` + * * parent: `=`, `:` + * * resource_name: `=`, `:` + * * state: `=`, `:` + * * category: `=`, `:` + * * external_uri: `=`, `:` + * * event_time: `=`, `>`, `<`, `>=`, `<=` + * * severity: `=`, `:` + * + * Usage: This should be milliseconds since epoch or an RFC3339 string. + * Examples: + * `event_time = "2019-06-10T16:07:18-07:00"` + * `event_time = 1560208038000` + * + * security_marks.marks: `=`, `:` + * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * + * For example, `source_properties.size = 100` is a valid filter string. + * + * Use a partial match on the empty string to filter based on a property + * existing: `source_properties.my_property : ""` + * + * Use a negated partial match on the empty string to filter based on a + * property not existing: `-source_properties.my_property : ""` + * @param {string} request.orderBy + * Expression that defines what fields and order to use for sorting. The + * string value should follow SQL syntax: comma separated list of fields. For + * example: "name,resource_properties.a_property". The default sorting order + * is ascending. To specify descending order for a field, a suffix " desc" + * should be appended to the field name. For example: "name + * desc,source_properties.a_property". Redundant space characters in the + * syntax are insignificant. "name desc,source_properties.a_property" and " + * name desc , source_properties.a_property " are equivalent. + * + * The following fields are supported: + * name + * parent + * state + * category + * resource_name + * event_time + * source_properties + * security_marks.marks + * @param {google.protobuf.Timestamp} request.readTime + * Time used as a reference point when filtering findings. The filter is + * limited to findings existing at the supplied time and their values are + * those at that specific time. Absence of this field will default to the + * API's version of NOW. + * @param {google.protobuf.Duration} request.compareDuration + * When compare_duration is set, the ListFindingsResult's "state_change" + * attribute is updated to indicate whether the finding had its state changed, + * the finding's state remained unchanged, or if the finding was added in any + * state during the compare_duration period of time that precedes the + * read_time. This is the time between (read_time - compare_duration) and + * read_time. + * + * The state_change value is derived based on the presence and state of the + * finding at the two points in time. Intermediate state changes between the + * two times don't affect the result. For example, the results aren't affected + * if the finding is made inactive and then active again. + * + * Possible "state_change" values when compare_duration is specified: + * + * * "CHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration, but changed its + * state at read_time. + * * "UNCHANGED": indicates that the finding was present and matched the given + * filter at the start of compare_duration and did not change + * state at read_time. + * * "ADDED": indicates that the finding did not match the given filter or + * was not present at the start of compare_duration, but was + * present at read_time. + * * "REMOVED": indicates that the finding was present and matched the + * filter at the start of compare_duration, but did not match + * the filter at read_time. + * + * If compare_duration is not specified, then the only possible state_change + * is "UNUSED", which will be the state_change set for all findings present at + * read_time. + * @param {google.protobuf.FieldMask} request.fieldMask + * A field mask to specify the Finding fields to be listed in the response. + * An empty field mask will list all fields. + * @param {string} request.pageToken + * The value returned by the last `ListFindingsResponse`; indicates + * that this is a continuation of a prior `ListFindings` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [ListFindingsResult]{@link google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult}. 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/v1p1beta1/security_center.list_findings.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_async + */ + listFindingsAsync( + request?: protos.google.cloud.securitycenter.v1p1beta1.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; + } + /** + * Lists notification configs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. + * 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 `listNotificationConfigsAsync()` + * 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. + */ + listNotificationConfigs( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + ] + >; + listNotificationConfigs( + request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig + > + ): void; + listNotificationConfigs( + request: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig + > + ): void; + listNotificationConfigs( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[], + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listNotificationConfigs( + 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. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig} 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 `listNotificationConfigsAsync()` + * 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. + */ + listNotificationConfigsStream( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + 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['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNotificationConfigs.createStream( + this.innerApiCalls.listNotificationConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listNotificationConfigs`, 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. Name of the organization to list notification configs. + * Its format is "organizations/[organization_id]". + * @param {string} request.pageToken + * The value returned by the last `ListNotificationConfigsResponse`; indicates + * that this is a continuation of a prior `ListNotificationConfigs` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [NotificationConfig]{@link google.cloud.securitycenter.v1p1beta1.NotificationConfig}. 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/v1p1beta1/security_center.list_notification_configs.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_async + */ + listNotificationConfigsAsync( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListNotificationConfigsRequest, + 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['listNotificationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNotificationConfigs.asyncIterate( + this.innerApiCalls['listNotificationConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all sources belonging to an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. + * 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 `listSourcesAsync()` + * 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. + */ + listSources( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ISource[], + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + ] + >; + listSources( + request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ISource + > + ): void; + listSources( + request: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ISource + > + ): void; + listSources( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ISource + >, + callback?: PaginationCallback< + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + | protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.securitycenter.v1p1beta1.ISource + > + ): Promise< + [ + protos.google.cloud.securitycenter.v1p1beta1.ISource[], + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest | null, + protos.google.cloud.securitycenter.v1p1beta1.IListSourcesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listSources(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 [Source]{@link google.cloud.securitycenter.v1p1beta1.Source} 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 `listSourcesAsync()` + * 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. + */ + listSourcesStream( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + 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['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSources.createStream( + this.innerApiCalls.listSources as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSources`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id], folders/[folder_id], or + * projects/[project_id]". + * @param {string} request.pageToken + * The value returned by the last `ListSourcesResponse`; indicates + * that this is a continuation of a prior `ListSources` call, and + * that the system should return the next page of data. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. Default is + * 10, minimum is 1, maximum is 1000. + * @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 + * [Source]{@link google.cloud.securitycenter.v1p1beta1.Source}. 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/v1p1beta1/security_center.list_sources.js + * region_tag:securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_async + */ + listSourcesAsync( + request?: protos.google.cloud.securitycenter.v1p1beta1.IListSourcesRequest, + 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['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSources.asyncIterate( + this.innerApiCalls['listSources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderAsset resource name string. + * + * @param {string} folder + * @param {string} asset + * @returns {string} Resource name string. + */ + folderAssetPath(folder: string, asset: string) { + return this.pathTemplates.folderAssetPathTemplate.render({ + folder: folder, + asset: asset, + }); + } + + /** + * Parse the folder from FolderAsset resource. + * + * @param {string} folderAssetName + * A fully-qualified path representing folder_asset resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAssetName(folderAssetName: string) { + return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName) + .folder; + } + + /** + * Parse the asset from FolderAsset resource. + * + * @param {string} folderAssetName + * A fully-qualified path representing folder_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromFolderAssetName(folderAssetName: string) { + return this.pathTemplates.folderAssetPathTemplate.match(folderAssetName) + .asset; + } + + /** + * Return a fully-qualified folderAssetSecurityMarks resource name string. + * + * @param {string} folder + * @param {string} asset + * @returns {string} Resource name string. + */ + folderAssetSecurityMarksPath(folder: string, asset: string) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.render({ + folder: folder, + asset: asset, + }); + } + + /** + * Parse the folder from FolderAssetSecurityMarks resource. + * + * @param {string} folderAssetSecurityMarksName + * A fully-qualified path representing folder_asset_securityMarks resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAssetSecurityMarksName( + folderAssetSecurityMarksName: string + ) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.match( + folderAssetSecurityMarksName + ).folder; + } + + /** + * Parse the asset from FolderAssetSecurityMarks resource. + * + * @param {string} folderAssetSecurityMarksName + * A fully-qualified path representing folder_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromFolderAssetSecurityMarksName( + folderAssetSecurityMarksName: string + ) { + return this.pathTemplates.folderAssetSecurityMarksPathTemplate.match( + folderAssetSecurityMarksName + ).asset; + } + + /** + * Return a fully-qualified folderSource resource name string. + * + * @param {string} folder + * @param {string} source + * @returns {string} Resource name string. + */ + folderSourcePath(folder: string, source: string) { + return this.pathTemplates.folderSourcePathTemplate.render({ + folder: folder, + source: source, + }); + } + + /** + * Parse the folder from FolderSource resource. + * + * @param {string} folderSourceName + * A fully-qualified path representing folder_source resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceName(folderSourceName: string) { + return this.pathTemplates.folderSourcePathTemplate.match(folderSourceName) + .folder; + } + + /** + * Parse the source from FolderSource resource. + * + * @param {string} folderSourceName + * A fully-qualified path representing folder_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceName(folderSourceName: string) { + return this.pathTemplates.folderSourcePathTemplate.match(folderSourceName) + .source; + } + + /** + * Return a fully-qualified folderSourceFinding resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + folderSourceFindingPath(folder: string, source: string, finding: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.render({ + folder: folder, + source: source, + finding: finding, + }); + } + + /** + * Parse the folder from FolderSourceFinding resource. + * + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).folder; + } + + /** + * Parse the source from FolderSourceFinding resource. + * + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).source; + } + + /** + * Parse the finding from FolderSourceFinding resource. + * + * @param {string} folderSourceFindingName + * A fully-qualified path representing folder_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceFindingName(folderSourceFindingName: string) { + return this.pathTemplates.folderSourceFindingPathTemplate.match( + folderSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified folderSourceFindingSecurityMarks resource name string. + * + * @param {string} folder + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + folderSourceFindingSecurityMarksPath( + folder: string, + source: string, + finding: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.render( + { + folder: folder, + source: source, + finding: finding, + } + ); + } + + /** + * Parse the folder from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).folder; + } + + /** + * Parse the source from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).source; + } + + /** + * Parse the finding from FolderSourceFindingSecurityMarks resource. + * + * @param {string} folderSourceFindingSecurityMarksName + * A fully-qualified path representing folder_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFolderSourceFindingSecurityMarksName( + folderSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match( + folderSourceFindingSecurityMarksName + ).finding; + } + + /** + * Return a fully-qualified notificationConfig resource name string. + * + * @param {string} organization + * @param {string} notification_config + * @returns {string} Resource name string. + */ + notificationConfigPath(organization: string, notificationConfig: string) { + return this.pathTemplates.notificationConfigPathTemplate.render({ + organization: organization, + notification_config: notificationConfig, + }); + } + + /** + * Parse the organization from NotificationConfig resource. + * + * @param {string} notificationConfigName + * A fully-qualified path representing NotificationConfig resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromNotificationConfigName(notificationConfigName: string) { + return this.pathTemplates.notificationConfigPathTemplate.match( + notificationConfigName + ).organization; + } + + /** + * Parse the notification_config from NotificationConfig resource. + * + * @param {string} notificationConfigName + * A fully-qualified path representing NotificationConfig resource. + * @returns {string} A string representing the notification_config. + */ + matchNotificationConfigFromNotificationConfigName( + notificationConfigName: string + ) { + return this.pathTemplates.notificationConfigPathTemplate.match( + notificationConfigName + ).notification_config; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Return a fully-qualified organizationAsset resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetPath(organization: string, asset: string) { + return this.pathTemplates.organizationAssetPathTemplate.render({ + organization: organization, + asset: asset, + }); + } + + /** + * Parse the organization from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetName(organizationAssetName: string) { + return this.pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).organization; + } + + /** + * Parse the asset from OrganizationAsset resource. + * + * @param {string} organizationAssetName + * A fully-qualified path representing organization_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetName(organizationAssetName: string) { + return this.pathTemplates.organizationAssetPathTemplate.match( + organizationAssetName + ).asset; + } + + /** + * Return a fully-qualified organizationAssetSecurityMarks resource name string. + * + * @param {string} organization + * @param {string} asset + * @returns {string} Resource name string. + */ + organizationAssetSecurityMarksPath(organization: string, asset: string) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.render( + { + organization: organization, + asset: asset, + } + ); + } + + /** + * Parse the organization from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAssetSecurityMarksName( + organizationAssetSecurityMarksName: string + ) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + organizationAssetSecurityMarksName + ).organization; + } + + /** + * Parse the asset from OrganizationAssetSecurityMarks resource. + * + * @param {string} organizationAssetSecurityMarksName + * A fully-qualified path representing organization_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromOrganizationAssetSecurityMarksName( + organizationAssetSecurityMarksName: string + ) { + return this.pathTemplates.organizationAssetSecurityMarksPathTemplate.match( + organizationAssetSecurityMarksName + ).asset; + } + + /** + * Return a fully-qualified organizationSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationSettingsPath(organization: string) { + return this.pathTemplates.organizationSettingsPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from OrganizationSettings resource. + * + * @param {string} organizationSettingsName + * A fully-qualified path representing OrganizationSettings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSettingsName( + organizationSettingsName: string + ) { + return this.pathTemplates.organizationSettingsPathTemplate.match( + organizationSettingsName + ).organization; + } + + /** + * Return a fully-qualified organizationSource resource name string. + * + * @param {string} organization + * @param {string} source + * @returns {string} Resource name string. + */ + organizationSourcePath(organization: string, source: string) { + return this.pathTemplates.organizationSourcePathTemplate.render({ + organization: organization, + source: source, + }); + } + + /** + * Parse the organization from OrganizationSource resource. + * + * @param {string} organizationSourceName + * A fully-qualified path representing organization_source resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceName(organizationSourceName: string) { + return this.pathTemplates.organizationSourcePathTemplate.match( + organizationSourceName + ).organization; + } + + /** + * Parse the source from OrganizationSource resource. + * + * @param {string} organizationSourceName + * A fully-qualified path representing organization_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceName(organizationSourceName: string) { + return this.pathTemplates.organizationSourcePathTemplate.match( + organizationSourceName + ).source; + } + + /** + * Return a fully-qualified organizationSourceFinding resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingPath( + organization: string, + source: string, + finding: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.render({ + organization: organization, + source: source, + finding: finding, + }); + } + + /** + * Parse the organization from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFinding resource. + * + * @param {string} organizationSourceFindingName + * A fully-qualified path representing organization_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingName( + organizationSourceFindingName: string + ) { + return this.pathTemplates.organizationSourceFindingPathTemplate.match( + organizationSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified organizationSourceFindingSecurityMarks resource name string. + * + * @param {string} organization + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + organizationSourceFindingSecurityMarksPath( + organization: string, + source: string, + finding: string + ) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render( + { + organization: organization, + source: source, + finding: finding, + } + ); + } + + /** + * Parse the organization from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName + ).organization; + } + + /** + * Parse the source from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName + ).source; + } + + /** + * Parse the finding from OrganizationSourceFindingSecurityMarks resource. + * + * @param {string} organizationSourceFindingSecurityMarksName + * A fully-qualified path representing organization_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromOrganizationSourceFindingSecurityMarksName( + organizationSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match( + organizationSourceFindingSecurityMarksName + ).finding; + } + + /** + * Return a fully-qualified projectAsset resource name string. + * + * @param {string} project + * @param {string} asset + * @returns {string} Resource name string. + */ + projectAssetPath(project: string, asset: string) { + return this.pathTemplates.projectAssetPathTemplate.render({ + project: project, + asset: asset, + }); + } + + /** + * Parse the project from ProjectAsset resource. + * + * @param {string} projectAssetName + * A fully-qualified path representing project_asset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAssetName(projectAssetName: string) { + return this.pathTemplates.projectAssetPathTemplate.match(projectAssetName) + .project; + } + + /** + * Parse the asset from ProjectAsset resource. + * + * @param {string} projectAssetName + * A fully-qualified path representing project_asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectAssetName(projectAssetName: string) { + return this.pathTemplates.projectAssetPathTemplate.match(projectAssetName) + .asset; + } + + /** + * Return a fully-qualified projectAssetSecurityMarks resource name string. + * + * @param {string} project + * @param {string} asset + * @returns {string} Resource name string. + */ + projectAssetSecurityMarksPath(project: string, asset: string) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.render({ + project: project, + asset: asset, + }); + } + + /** + * Parse the project from ProjectAssetSecurityMarks resource. + * + * @param {string} projectAssetSecurityMarksName + * A fully-qualified path representing project_asset_securityMarks resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAssetSecurityMarksName( + projectAssetSecurityMarksName: string + ) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.match( + projectAssetSecurityMarksName + ).project; + } + + /** + * Parse the asset from ProjectAssetSecurityMarks resource. + * + * @param {string} projectAssetSecurityMarksName + * A fully-qualified path representing project_asset_securityMarks resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectAssetSecurityMarksName( + projectAssetSecurityMarksName: string + ) { + return this.pathTemplates.projectAssetSecurityMarksPathTemplate.match( + projectAssetSecurityMarksName + ).asset; + } + + /** + * Return a fully-qualified projectSource resource name string. + * + * @param {string} project + * @param {string} source + * @returns {string} Resource name string. + */ + projectSourcePath(project: string, source: string) { + return this.pathTemplates.projectSourcePathTemplate.render({ + project: project, + source: source, + }); + } + + /** + * Parse the project from ProjectSource resource. + * + * @param {string} projectSourceName + * A fully-qualified path representing project_source resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceName(projectSourceName: string) { + return this.pathTemplates.projectSourcePathTemplate.match(projectSourceName) + .project; + } + + /** + * Parse the source from ProjectSource resource. + * + * @param {string} projectSourceName + * A fully-qualified path representing project_source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceName(projectSourceName: string) { + return this.pathTemplates.projectSourcePathTemplate.match(projectSourceName) + .source; + } + + /** + * Return a fully-qualified projectSourceFinding resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceFindingPath(project: string, source: string, finding: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.render({ + project: project, + source: source, + finding: finding, + }); + } + + /** + * Parse the project from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).project; + } + + /** + * Parse the source from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).source; + } + + /** + * Parse the finding from ProjectSourceFinding resource. + * + * @param {string} projectSourceFindingName + * A fully-qualified path representing project_source_finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingName(projectSourceFindingName: string) { + return this.pathTemplates.projectSourceFindingPathTemplate.match( + projectSourceFindingName + ).finding; + } + + /** + * Return a fully-qualified projectSourceFindingSecurityMarks resource name string. + * + * @param {string} project + * @param {string} source + * @param {string} finding + * @returns {string} Resource name string. + */ + projectSourceFindingSecurityMarksPath( + project: string, + source: string, + finding: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.render( + { + project: project, + source: source, + finding: finding, + } + ); + } + + /** + * Parse the project from ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).project; + } + + /** + * Parse the source from ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the source. + */ + matchSourceFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).source; + } + + /** + * Parse the finding from ProjectSourceFindingSecurityMarks resource. + * + * @param {string} projectSourceFindingSecurityMarksName + * A fully-qualified path representing project_source_finding_securityMarks resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromProjectSourceFindingSecurityMarksName( + projectSourceFindingSecurityMarksName: string + ) { + return this.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match( + projectSourceFindingSecurityMarksName + ).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.securityCenterStub && !this._terminated) { + return this.securityCenterStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json new file mode 100644 index 00000000000..b8821e07010 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client_config.json @@ -0,0 +1,141 @@ +{ + "interfaces": { + "google.cloud.securitycenter.v1p1beta1.SecurityCenter": { + "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": { + "CreateSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetOrganizationSettings": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetSource": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupAssets": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GroupFindings": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAssets": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindings": { + "timeout_millis": 480000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListNotificationConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListSources": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RunAssetDiscovery": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetFindingState": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateFinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateOrganizationSettings": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSecurityMarks": { + "timeout_millis": 480000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json new file mode 100644 index 00000000000..dcb821bf6e0 --- /dev/null +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/securitycenter/v1p1beta1/asset.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/finding.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/folder.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/notification_config.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/notification_message.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/organization_settings.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/resource.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/security_marks.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto", + "../../protos/google/cloud/securitycenter/v1p1beta1/source.proto" +] diff --git a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..2684cdee5e3 --- /dev/null +++ b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// 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 securitycenter = require('@google-cloud/security-center'); + +function main() { + const securityCenterClient = new securitycenter.SecurityCenterClient(); +} + +main(); diff --git a/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-securitycenter/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..1e7b0783212 --- /dev/null +++ b/packages/google-cloud-securitycenter/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 {SecurityCenterClient} from '@google-cloud/security-center'; + +// check that the client class type name can be used +function doStuffWithSecurityCenterClient(client: SecurityCenterClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const securityCenterClient = new SecurityCenterClient(); + doStuffWithSecurityCenterClient(securityCenterClient); +} + +main(); diff --git a/packages/google-cloud-securitycenter/system-test/install.ts b/packages/google-cloud-securitycenter/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-securitycenter/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-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts new file mode 100644 index 00000000000..de50b5f954a --- /dev/null +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -0,0 +1,9005 @@ +// 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 securitycenterModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.SecurityCenterClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + securitycenterModule.v1.SecurityCenterClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + securitycenterModule.v1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = securitycenterModule.v1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new securitycenterModule.v1.SecurityCenterClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + await client.initialize(); + assert(client.securityCenterStub); + }); + + it('has close method for the initialized client', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.securityCenterStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitycenterModule.v1.SecurityCenterClient({ + 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 securitycenterModule.v1.SecurityCenterClient({ + 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('createSource', () => { + it('invokes createSource without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.createSource = stubSimpleCall(expectedResponse); + const [response] = await client.createSource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSource without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.createSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSource with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSource with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSource(request), expectedError); + }); + }); + + describe('createFinding', () => { + it('invokes createFinding without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateFindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.createFinding = stubSimpleCall(expectedResponse); + const [response] = await client.createFinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFinding without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateFindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.createFinding = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFinding with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateFindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFinding = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createFinding(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFinding with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateFindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createFinding(request), expectedError); + }); + }); + + describe('createMuteConfig', () => { + it('invokes createMuteConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateMuteConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ); + client.innerApiCalls.createMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.createMuteConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMuteConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateMuteConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ); + client.innerApiCalls.createMuteConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMuteConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IMuteConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMuteConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateMuteConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMuteConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createMuteConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMuteConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateMuteConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateMuteConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createMuteConfig(request), expectedError); + }); + }); + + describe('createNotificationConfig', () => { + it('invokes createNotificationConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ); + client.innerApiCalls.createNotificationConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.createNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ); + client.innerApiCalls.createNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNotificationConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createNotificationConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createNotificationConfig(request), + expectedError + ); + }); + }); + + describe('deleteMuteConfig', () => { + it('invokes deleteMuteConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteMuteConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.deleteMuteConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMuteConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteMuteConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteMuteConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMuteConfig( + 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.deleteMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMuteConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteMuteConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMuteConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteMuteConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMuteConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteMuteConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteMuteConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteMuteConfig(request), expectedError); + }); + }); + + describe('deleteNotificationConfig', () => { + it('invokes deleteNotificationConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteNotificationConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteNotificationConfig( + 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.deleteNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNotificationConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteNotificationConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteNotificationConfig(request), + expectedError + ); + }); + }); + + describe('getBigQueryExport', () => { + it('invokes getBigQueryExport without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetBigQueryExportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ); + client.innerApiCalls.getBigQueryExport = stubSimpleCall(expectedResponse); + const [response] = await client.getBigQueryExport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBigQueryExport without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetBigQueryExportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ); + client.innerApiCalls.getBigQueryExport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBigQueryExport( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IBigQueryExport | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBigQueryExport with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetBigQueryExportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBigQueryExport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getBigQueryExport(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBigQueryExport with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetBigQueryExportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetBigQueryExportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBigQueryExport(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('getMuteConfig', () => { + it('invokes getMuteConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetMuteConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ); + client.innerApiCalls.getMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getMuteConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMuteConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetMuteConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ); + client.innerApiCalls.getMuteConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMuteConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IMuteConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMuteConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetMuteConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMuteConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getMuteConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMuteConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetMuteConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetMuteConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMuteConfig(request), expectedError); + }); + }); + + describe('getNotificationConfig', () => { + it('invokes getNotificationConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ); + client.innerApiCalls.getNotificationConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.getNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ); + client.innerApiCalls.getNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNotificationConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getNotificationConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getNotificationConfig(request), + expectedError + ); + }); + }); + + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.OrganizationSettings() + ); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.getOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.OrganizationSettings() + ); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganizationSettings with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); + }); + }); + + describe('getSource', () => { + it('invokes getSource without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); + const [response] = await client.getSource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSource without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.getSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSource with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSource with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSource(request), expectedError); + }); + }); + + describe('setFindingState', () => { + it('invokes setFindingState without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetFindingStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); + const [response] = await client.setFindingState(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setFindingState without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetFindingStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.setFindingState = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setFindingState( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setFindingState with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetFindingStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setFindingState = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setFindingState(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setFindingState with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetFindingStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetFindingStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setFindingState(request), expectedError); + }); + }); + + describe('setMute', () => { + it('invokes setMute without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetMuteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetMuteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.setMute = stubSimpleCall(expectedResponse); + const [response] = await client.setMute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMute as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setMute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMute without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetMuteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetMuteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.setMute = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMute( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setMute as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setMute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMute with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetMuteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetMuteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setMute = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setMute(request), expectedError); + const actualRequest = (client.innerApiCalls.setMute as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setMute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setMute with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SetMuteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.SetMuteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setMute(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('updateExternalSystem', () => { + it('invokes updateExternalSystem without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() + ); + request.externalSystem ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateExternalSystemRequest', + ['externalSystem', 'name'] + ); + request.externalSystem.name = defaultValue1; + const expectedHeaderRequestParams = `external_system.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ExternalSystem() + ); + client.innerApiCalls.updateExternalSystem = + stubSimpleCall(expectedResponse); + const [response] = await client.updateExternalSystem(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExternalSystem as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExternalSystem as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExternalSystem without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() + ); + request.externalSystem ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateExternalSystemRequest', + ['externalSystem', 'name'] + ); + request.externalSystem.name = defaultValue1; + const expectedHeaderRequestParams = `external_system.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ExternalSystem() + ); + client.innerApiCalls.updateExternalSystem = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExternalSystem( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IExternalSystem | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExternalSystem as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExternalSystem as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExternalSystem with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() + ); + request.externalSystem ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateExternalSystemRequest', + ['externalSystem', 'name'] + ); + request.externalSystem.name = defaultValue1; + const expectedHeaderRequestParams = `external_system.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExternalSystem = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateExternalSystem(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateExternalSystem as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExternalSystem as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExternalSystem with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateExternalSystemRequest() + ); + request.externalSystem ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateExternalSystemRequest', + ['externalSystem', 'name'] + ); + request.externalSystem.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateExternalSystem(request), expectedError); + }); + }); + + describe('updateFinding', () => { + it('invokes updateFinding without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateFindingRequest', + ['finding', 'name'] + ); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); + const [response] = await client.updateFinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFinding without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateFindingRequest', + ['finding', 'name'] + ); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Finding() + ); + client.innerApiCalls.updateFinding = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFinding with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateFindingRequest', + ['finding', 'name'] + ); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFinding = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateFinding(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFinding with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateFindingRequest', + ['finding', 'name'] + ); + request.finding.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateFinding(request), expectedError); + }); + }); + + describe('updateMuteConfig', () => { + it('invokes updateMuteConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() + ); + request.muteConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateMuteConfigRequest', + ['muteConfig', 'name'] + ); + request.muteConfig.name = defaultValue1; + const expectedHeaderRequestParams = `mute_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ); + client.innerApiCalls.updateMuteConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateMuteConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMuteConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() + ); + request.muteConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateMuteConfigRequest', + ['muteConfig', 'name'] + ); + request.muteConfig.name = defaultValue1; + const expectedHeaderRequestParams = `mute_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ); + client.innerApiCalls.updateMuteConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMuteConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IMuteConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMuteConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() + ); + request.muteConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateMuteConfigRequest', + ['muteConfig', 'name'] + ); + request.muteConfig.name = defaultValue1; + const expectedHeaderRequestParams = `mute_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMuteConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateMuteConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateMuteConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMuteConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMuteConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateMuteConfigRequest() + ); + request.muteConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateMuteConfigRequest', + ['muteConfig', 'name'] + ); + request.muteConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateMuteConfig(request), expectedError); + }); + }); + + describe('updateNotificationConfig', () => { + it('invokes updateNotificationConfig without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ); + client.innerApiCalls.updateNotificationConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ); + client.innerApiCalls.updateNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNotificationConfig with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateNotificationConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateNotificationConfig(request), + expectedError + ); + }); + }); + + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.updateOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOrganizationSettings with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); + const [response] = await client.updateSource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSource without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ); + client.innerApiCalls.updateSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSource with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSource with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSource(request), expectedError); + }); + }); + + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSecurityMarks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityMarks without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSecurityMarks( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISecurityMarks | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityMarks with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityMarks with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); + request.securityMarks.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + }); + }); + + describe('createBigQueryExport', () => { + it('invokes createBigQueryExport without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ); + client.innerApiCalls.createBigQueryExport = + stubSimpleCall(expectedResponse); + const [response] = await client.createBigQueryExport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBigQueryExport without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ); + client.innerApiCalls.createBigQueryExport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBigQueryExport( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IBigQueryExport | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBigQueryExport with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBigQueryExport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createBigQueryExport(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBigQueryExport with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.CreateBigQueryExportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.CreateBigQueryExportRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createBigQueryExport(request), expectedError); + }); + }); + + describe('deleteBigQueryExport', () => { + it('invokes deleteBigQueryExport without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBigQueryExport = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteBigQueryExport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBigQueryExport without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBigQueryExport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBigQueryExport( + 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.deleteBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBigQueryExport with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBigQueryExport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBigQueryExport(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBigQueryExport with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteBigQueryExport(request), expectedError); + }); + }); + + describe('updateBigQueryExport', () => { + it('invokes updateBigQueryExport without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() + ); + request.bigQueryExport ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest', + ['bigQueryExport', 'name'] + ); + request.bigQueryExport.name = defaultValue1; + const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ); + client.innerApiCalls.updateBigQueryExport = + stubSimpleCall(expectedResponse); + const [response] = await client.updateBigQueryExport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBigQueryExport without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() + ); + request.bigQueryExport ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest', + ['bigQueryExport', 'name'] + ); + request.bigQueryExport.name = defaultValue1; + const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ); + client.innerApiCalls.updateBigQueryExport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBigQueryExport( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IBigQueryExport | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBigQueryExport with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() + ); + request.bigQueryExport ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest', + ['bigQueryExport', 'name'] + ); + request.bigQueryExport.name = defaultValue1; + const expectedHeaderRequestParams = `big_query_export.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBigQueryExport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBigQueryExport(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBigQueryExport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBigQueryExport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBigQueryExport with closed client', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest() + ); + request.bigQueryExport ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest', + ['bigQueryExport', 'name'] + ); + request.bigQueryExport.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateBigQueryExport(request), expectedError); + }); + }); + + describe('bulkMuteFindings', () => { + it('invokes bulkMuteFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.bulkMuteFindings = + stubLongRunningCall(expectedResponse); + const [operation] = await client.bulkMuteFindings(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes bulkMuteFindings without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.bulkMuteFindings = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.bulkMuteFindings( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.securitycenter.v1.IBulkMuteFindingsResponse, + protos.google.protobuf.IEmpty + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes bulkMuteFindings with call error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkMuteFindings = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.bulkMuteFindings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes bulkMuteFindings with LRO error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BulkMuteFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.BulkMuteFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkMuteFindings = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.bulkMuteFindings(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.bulkMuteFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBulkMuteFindingsProgress without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBulkMuteFindingsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBulkMuteFindingsProgress with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkBulkMuteFindingsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCall(expectedResponse); + const [operation] = await client.runAssetDiscovery(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAssetDiscovery without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runAssetDiscovery( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.securitycenter.v1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAssetDiscovery with call error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.runAssetDiscovery(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAssetDiscovery with LRO error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.runAssetDiscovery(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRunAssetDiscoveryProgress without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunAssetDiscoveryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunAssetDiscoveryProgress with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRunAssetDiscoveryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('groupAssets', () => { + it('invokes groupAssets without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); + const [response] = await client.groupAssets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupAssets without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.groupAssets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IGroupResult[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupAssets with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.groupAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.groupAssets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupAssetsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + 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.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes groupAssetsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupAssets without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; + const iterable = client.groupAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupAssets with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.groupAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('groupFindings', () => { + it('invokes groupFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); + const [response] = await client.groupFindings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupFindings without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.groupFindings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IGroupResult[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupFindings with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.groupFindings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.groupFindings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupFindingsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.groupFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + 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.groupFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupFindings, request) + ); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes groupFindingsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.groupFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.GroupResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.GroupResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupFindings, request) + ); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupFindings without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupResult() + ), + ]; + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; + const iterable = client.groupFindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupFindings with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.groupFindingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.innerApiCalls.listAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAssets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.descriptors.page.listAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + ) => { + 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.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.descriptors.page.listAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = + []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listAssets.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 securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + ]; + 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 securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.innerApiCalls.listFindings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFindings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] + | 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 securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.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 securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.descriptors.page.listFindings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + ) => { + 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 securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.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.securitycenter.v1.ListFindingsResponse.ListFindingsResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + ) => { + 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 securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = + []; + 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 securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.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.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = + []; + 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('listMuteConfigs', () => { + it('invokes listMuteConfigs without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ), + ]; + client.innerApiCalls.listMuteConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listMuteConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMuteConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMuteConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMuteConfigs without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ), + ]; + client.innerApiCalls.listMuteConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMuteConfigs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.IMuteConfig[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMuteConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMuteConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMuteConfigs with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMuteConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listMuteConfigs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listMuteConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMuteConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMuteConfigsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ), + ]; + client.descriptors.page.listMuteConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listMuteConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.MuteConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { + 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.listMuteConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMuteConfigs, request) + ); + assert( + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMuteConfigsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMuteConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listMuteConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.MuteConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.MuteConfig) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMuteConfigs, request) + ); + assert( + (client.descriptors.page.listMuteConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMuteConfigs without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.MuteConfig() + ), + ]; + client.descriptors.page.listMuteConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IMuteConfig[] = []; + const iterable = client.listMuteConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMuteConfigs with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListMuteConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListMuteConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMuteConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMuteConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IMuteConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listMuteConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listNotificationConfigs', () => { + it('invokes listNotificationConfigs without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + ]; + client.innerApiCalls.listNotificationConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listNotificationConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNotificationConfigs without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + ]; + client.innerApiCalls.listNotificationConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNotificationConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1.INotificationConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNotificationConfigs with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNotificationConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listNotificationConfigs(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNotificationConfigsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + ]; + client.descriptors.page.listNotificationConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listNotificationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.NotificationConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1.NotificationConfig + ) => { + 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.listNotificationConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listNotificationConfigs, request) + ); + assert( + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listNotificationConfigsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNotificationConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listNotificationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.NotificationConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1.NotificationConfig + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listNotificationConfigs, request) + ); + assert( + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNotificationConfigs without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.NotificationConfig() + ), + ]; + client.descriptors.page.listNotificationConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = + []; + const iterable = client.listNotificationConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNotificationConfigs with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNotificationConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNotificationConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSources', () => { + it('invokes listSources without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + ]; + client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); + const [response] = await client.listSources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSources without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + ]; + client.innerApiCalls.listSources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1.ISource[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSources with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSources(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSourcesStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + ]; + client.descriptors.page.listSources.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.Source[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.Source) => { + 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.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSourcesStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.Source[] = []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.Source) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSources without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.Source() + ), + ]; + client.descriptors.page.listSources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.ISource[] = []; + const iterable = client.listSourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSources with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.ISource[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBigQueryExports', () => { + it('invokes listBigQueryExports without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ), + ]; + client.innerApiCalls.listBigQueryExports = + stubSimpleCall(expectedResponse); + const [response] = await client.listBigQueryExports(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBigQueryExports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBigQueryExports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBigQueryExports without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ), + ]; + client.innerApiCalls.listBigQueryExports = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBigQueryExports( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1.IBigQueryExport[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBigQueryExports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBigQueryExports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBigQueryExports with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBigQueryExports = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listBigQueryExports(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listBigQueryExports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBigQueryExports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBigQueryExportsStream without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ), + ]; + client.descriptors.page.listBigQueryExports.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBigQueryExportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.BigQueryExport[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.BigQueryExport) => { + 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.listBigQueryExports.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBigQueryExports, request) + ); + assert( + (client.descriptors.page.listBigQueryExports.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBigQueryExportsStream with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBigQueryExports.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listBigQueryExportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1.BigQueryExport[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1.BigQueryExport) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBigQueryExports.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBigQueryExports, request) + ); + assert( + (client.descriptors.page.listBigQueryExports.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBigQueryExports without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1.BigQueryExport() + ), + ]; + client.descriptors.page.listBigQueryExports.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1.IBigQueryExport[] = + []; + const iterable = client.listBigQueryExportsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBigQueryExports with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1.ListBigQueryExportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1.ListBigQueryExportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBigQueryExports.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBigQueryExportsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1.IBigQueryExport[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listBigQueryExports.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('folderAsset', () => { + const fakePath = '/rendered/path/folderAsset'; + const expectedParameters = { + folder: 'folderValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderAssetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderAssetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderAssetPath', () => { + const result = client.folderAssetPath('folderValue', 'assetValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderAssetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderAssetName', () => { + const result = client.matchFolderFromFolderAssetName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromFolderAssetName', () => { + const result = client.matchAssetFromFolderAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.folderAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderAssetSecurityMarks', () => { + const fakePath = '/rendered/path/folderAssetSecurityMarks'; + const expectedParameters = { + folder: 'folderValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderAssetSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderAssetSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderAssetSecurityMarksPath', () => { + const result = client.folderAssetSecurityMarksPath( + 'folderValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderAssetSecurityMarksName', () => { + const result = + client.matchFolderFromFolderAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromFolderAssetSecurityMarksName', () => { + const result = + client.matchAssetFromFolderAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderExport', () => { + const fakePath = '/rendered/path/folderExport'; + const expectedParameters = { + folder: 'folderValue', + export: 'exportValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderExportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderExportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderExportPath', () => { + const result = client.folderExportPath('folderValue', 'exportValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderExportPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderExportName', () => { + const result = client.matchFolderFromFolderExportName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderExportPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExportFromFolderExportName', () => { + const result = client.matchExportFromFolderExportName(fakePath); + assert.strictEqual(result, 'exportValue'); + assert( + (client.pathTemplates.folderExportPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderMuteConfig', () => { + const fakePath = '/rendered/path/folderMuteConfig'; + const expectedParameters = { + folder: 'folderValue', + mute_config: 'muteConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderMuteConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderMuteConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderMuteConfigPath', () => { + const result = client.folderMuteConfigPath( + 'folderValue', + 'muteConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderMuteConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderMuteConfigName', () => { + const result = client.matchFolderFromFolderMuteConfigName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderMuteConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMuteConfigFromFolderMuteConfigName', () => { + const result = client.matchMuteConfigFromFolderMuteConfigName(fakePath); + assert.strictEqual(result, 'muteConfigValue'); + assert( + (client.pathTemplates.folderMuteConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderNotificationConfig', () => { + const fakePath = '/rendered/path/folderNotificationConfig'; + const expectedParameters = { + folder: 'folderValue', + notification_config: 'notificationConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderNotificationConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderNotificationConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderNotificationConfigPath', () => { + const result = client.folderNotificationConfigPath( + 'folderValue', + 'notificationConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderNotificationConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderNotificationConfigName', () => { + const result = + client.matchFolderFromFolderNotificationConfigName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotificationConfigFromFolderNotificationConfigName', () => { + const result = + client.matchNotificationConfigFromFolderNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'notificationConfigValue'); + assert( + ( + client.pathTemplates.folderNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSource', () => { + const fakePath = '/rendered/path/folderSource'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSourcePath', () => { + const result = client.folderSourcePath('folderValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderSourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceName', () => { + const result = client.matchFolderFromFolderSourceName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceName', () => { + const result = client.matchSourceFromFolderSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.folderSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSourceFinding', () => { + const fakePath = '/rendered/path/folderSourceFinding'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourceFindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSourceFindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSourceFindingPath', () => { + const result = client.folderSourceFindingPath( + 'folderValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceFindingName', () => { + const result = client.matchFolderFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceFindingName', () => { + const result = client.matchSourceFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFolderSourceFindingName', () => { + const result = client.matchFindingFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSourceFindingExternalsystem', () => { + const fakePath = '/rendered/path/folderSourceFindingExternalsystem'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + finding: 'findingValue', + externalsystem: 'externalsystemValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceFindingExternalsystemPath', () => { + const result = client.folderSourceFindingExternalsystemPath( + 'folderValue', + 'sourceValue', + 'findingValue', + 'externalsystemValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceFindingExternalsystemName', () => { + const result = + client.matchFolderFromFolderSourceFindingExternalsystemName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceFindingExternalsystemName', () => { + const result = + client.matchSourceFromFolderSourceFindingExternalsystemName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFolderSourceFindingExternalsystemName', () => { + const result = + client.matchFindingFromFolderSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExternalsystemFromFolderSourceFindingExternalsystemName', () => { + const result = + client.matchExternalsystemFromFolderSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'externalsystemValue'); + assert( + ( + client.pathTemplates.folderSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/folderSourceFindingSecurityMarks'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceFindingSecurityMarksPath', () => { + const result = client.folderSourceFindingSecurityMarksPath( + 'folderValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchFolderFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationAsset', () => { + const fakePath = '/rendered/path/organizationAsset'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationAssetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationAssetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationAssetPath', () => { + const result = client.organizationAssetPath( + 'organizationValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationAssetName', () => { + const result = + client.matchOrganizationFromOrganizationAssetName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromOrganizationAssetName', () => { + const result = client.matchAssetFromOrganizationAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationAssetSecurityMarks', () => { + const fakePath = '/rendered/path/organizationAssetSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationAssetSecurityMarksPath', () => { + const result = client.organizationAssetSecurityMarksPath( + 'organizationValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationAssetSecurityMarksName', () => { + const result = + client.matchOrganizationFromOrganizationAssetSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromOrganizationAssetSecurityMarksName', () => { + const result = + client.matchAssetFromOrganizationAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationExport', () => { + const fakePath = '/rendered/path/organizationExport'; + const expectedParameters = { + organization: 'organizationValue', + export: 'exportValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationExportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationExportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationExportPath', () => { + const result = client.organizationExportPath( + 'organizationValue', + 'exportValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationExportPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationExportName', () => { + const result = + client.matchOrganizationFromOrganizationExportName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationExportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExportFromOrganizationExportName', () => { + const result = client.matchExportFromOrganizationExportName(fakePath); + assert.strictEqual(result, 'exportValue'); + assert( + ( + client.pathTemplates.organizationExportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationMuteConfig', () => { + const fakePath = '/rendered/path/organizationMuteConfig'; + const expectedParameters = { + organization: 'organizationValue', + mute_config: 'muteConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationMuteConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationMuteConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationMuteConfigPath', () => { + const result = client.organizationMuteConfigPath( + 'organizationValue', + 'muteConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationMuteConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationMuteConfigName', () => { + const result = + client.matchOrganizationFromOrganizationMuteConfigName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationMuteConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMuteConfigFromOrganizationMuteConfigName', () => { + const result = + client.matchMuteConfigFromOrganizationMuteConfigName(fakePath); + assert.strictEqual(result, 'muteConfigValue'); + assert( + ( + client.pathTemplates.organizationMuteConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationNotificationConfig', () => { + const fakePath = '/rendered/path/organizationNotificationConfig'; + const expectedParameters = { + organization: 'organizationValue', + notification_config: 'notificationConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationNotificationConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationNotificationConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationNotificationConfigPath', () => { + const result = client.organizationNotificationConfigPath( + 'organizationValue', + 'notificationConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationNotificationConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationNotificationConfigName', () => { + const result = + client.matchOrganizationFromOrganizationNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotificationConfigFromOrganizationNotificationConfigName', () => { + const result = + client.matchNotificationConfigFromOrganizationNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'notificationConfigValue'); + assert( + ( + client.pathTemplates.organizationNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSettings', () => { + const fakePath = '/rendered/path/organizationSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSettingsPath', () => { + const result = client.organizationSettingsPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSettingsName', () => { + const result = + client.matchOrganizationFromOrganizationSettingsName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSource', () => { + const fakePath = '/rendered/path/organizationSource'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSourcePath', () => { + const result = client.organizationSourcePath( + 'organizationValue', + 'sourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSourcePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceName', () => { + const result = + client.matchOrganizationFromOrganizationSourceName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceName', () => { + const result = client.matchSourceFromOrganizationSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.organizationSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSourceFinding', () => { + const fakePath = '/rendered/path/organizationSourceFinding'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourceFindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSourceFindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSourceFindingPath', () => { + const result = client.organizationSourceFindingPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceFindingName', () => { + const result = + client.matchOrganizationFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingName', () => { + const result = + client.matchSourceFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingName', () => { + const result = + client.matchFindingFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSourceFindingExternalsystem', () => { + const fakePath = '/rendered/path/organizationSourceFindingExternalsystem'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + externalsystem: 'externalsystemValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingExternalsystemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceFindingExternalsystemPath', () => { + const result = client.organizationSourceFindingExternalsystemPath( + 'organizationValue', + 'sourceValue', + 'findingValue', + 'externalsystemValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationSourceFindingExternalsystemPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceFindingExternalsystemName', () => { + const result = + client.matchOrganizationFromOrganizationSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingExternalsystemName', () => { + const result = + client.matchSourceFromOrganizationSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingExternalsystemName', () => { + const result = + client.matchFindingFromOrganizationSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExternalsystemFromOrganizationSourceFindingExternalsystemName', () => { + const result = + client.matchExternalsystemFromOrganizationSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'externalsystemValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/organizationSourceFindingSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceFindingSecurityMarksPath', () => { + const result = client.organizationSourceFindingSecurityMarksPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAsset', () => { + const fakePath = '/rendered/path/projectAsset'; + const expectedParameters = { + project: 'projectValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAssetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAssetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAssetPath', () => { + const result = client.projectAssetPath('projectValue', 'assetValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAssetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAssetName', () => { + const result = client.matchProjectFromProjectAssetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromProjectAssetName', () => { + const result = client.matchAssetFromProjectAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.projectAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAssetSecurityMarks', () => { + const fakePath = '/rendered/path/projectAssetSecurityMarks'; + const expectedParameters = { + project: 'projectValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAssetSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAssetSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAssetSecurityMarksPath', () => { + const result = client.projectAssetSecurityMarksPath( + 'projectValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAssetSecurityMarksName', () => { + const result = + client.matchProjectFromProjectAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromProjectAssetSecurityMarksName', () => { + const result = + client.matchAssetFromProjectAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectExport', () => { + const fakePath = '/rendered/path/projectExport'; + const expectedParameters = { + project: 'projectValue', + export: 'exportValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectExportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectExportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectExportPath', () => { + const result = client.projectExportPath('projectValue', 'exportValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectExportPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectExportName', () => { + const result = client.matchProjectFromProjectExportName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectExportPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExportFromProjectExportName', () => { + const result = client.matchExportFromProjectExportName(fakePath); + assert.strictEqual(result, 'exportValue'); + assert( + (client.pathTemplates.projectExportPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectMuteConfig', () => { + const fakePath = '/rendered/path/projectMuteConfig'; + const expectedParameters = { + project: 'projectValue', + mute_config: 'muteConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectMuteConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectMuteConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectMuteConfigPath', () => { + const result = client.projectMuteConfigPath( + 'projectValue', + 'muteConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectMuteConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectMuteConfigName', () => { + const result = client.matchProjectFromProjectMuteConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectMuteConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMuteConfigFromProjectMuteConfigName', () => { + const result = + client.matchMuteConfigFromProjectMuteConfigName(fakePath); + assert.strictEqual(result, 'muteConfigValue'); + assert( + ( + client.pathTemplates.projectMuteConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectNotificationConfig', () => { + const fakePath = '/rendered/path/projectNotificationConfig'; + const expectedParameters = { + project: 'projectValue', + notification_config: 'notificationConfigValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectNotificationConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectNotificationConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectNotificationConfigPath', () => { + const result = client.projectNotificationConfigPath( + 'projectValue', + 'notificationConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectNotificationConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectNotificationConfigName', () => { + const result = + client.matchProjectFromProjectNotificationConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotificationConfigFromProjectNotificationConfigName', () => { + const result = + client.matchNotificationConfigFromProjectNotificationConfigName( + fakePath + ); + assert.strictEqual(result, 'notificationConfigValue'); + assert( + ( + client.pathTemplates.projectNotificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSource', () => { + const fakePath = '/rendered/path/projectSource'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSourcePath', () => { + const result = client.projectSourcePath('projectValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectSourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceName', () => { + const result = client.matchProjectFromProjectSourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceName', () => { + const result = client.matchSourceFromProjectSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.projectSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSourceFinding', () => { + const fakePath = '/rendered/path/projectSourceFinding'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourceFindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSourceFindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSourceFindingPath', () => { + const result = client.projectSourceFindingPath( + 'projectValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceFindingName', () => { + const result = + client.matchProjectFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceFindingName', () => { + const result = client.matchSourceFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromProjectSourceFindingName', () => { + const result = + client.matchFindingFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSourceFindingExternalsystem', () => { + const fakePath = '/rendered/path/projectSourceFindingExternalsystem'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + finding: 'findingValue', + externalsystem: 'externalsystemValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSourceFindingExternalsystemPath', () => { + const result = client.projectSourceFindingExternalsystemPath( + 'projectValue', + 'sourceValue', + 'findingValue', + 'externalsystemValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceFindingExternalsystemName', () => { + const result = + client.matchProjectFromProjectSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceFindingExternalsystemName', () => { + const result = + client.matchSourceFromProjectSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromProjectSourceFindingExternalsystemName', () => { + const result = + client.matchFindingFromProjectSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExternalsystemFromProjectSourceFindingExternalsystemName', () => { + const result = + client.matchExternalsystemFromProjectSourceFindingExternalsystemName( + fakePath + ); + assert.strictEqual(result, 'externalsystemValue'); + assert( + ( + client.pathTemplates.projectSourceFindingExternalsystemPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/projectSourceFindingSecurityMarks'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSourceFindingSecurityMarksPath', () => { + const result = client.projectSourceFindingSecurityMarksPath( + 'projectValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchProjectFromProjectSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromProjectSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromProjectSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts new file mode 100644 index 00000000000..01bb5be2f6e --- /dev/null +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -0,0 +1,4120 @@ +// 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 securitycenterModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.SecurityCenterClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + securitycenterModule.v1beta1.SecurityCenterClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + securitycenterModule.v1beta1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = securitycenterModule.v1beta1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + await client.initialize(); + assert(client.securityCenterStub); + }); + + it('has close method for the initialized client', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.securityCenterStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + 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 securitycenterModule.v1beta1.SecurityCenterClient({ + 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('createSource', () => { + it('invokes createSource without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ); + client.innerApiCalls.createSource = stubSimpleCall(expectedResponse); + const [response] = await client.createSource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSource without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ); + client.innerApiCalls.createSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSource with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSource with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSource(request), expectedError); + }); + }); + + describe('createFinding', () => { + it('invokes createFinding without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateFindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ); + client.innerApiCalls.createFinding = stubSimpleCall(expectedResponse); + const [response] = await client.createFinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFinding without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateFindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ); + client.innerApiCalls.createFinding = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFinding with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateFindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFinding = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createFinding(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFinding with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.CreateFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.CreateFindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createFinding(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() + ); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.getOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() + ); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganizationSettings with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); + }); + }); + + describe('getSource', () => { + it('invokes getSource without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ); + client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); + const [response] = await client.getSource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSource without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ); + client.innerApiCalls.getSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSource with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSource with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSource(request), expectedError); + }); + }); + + describe('setFindingState', () => { + it('invokes setFindingState without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.SetFindingStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ); + client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); + const [response] = await client.setFindingState(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setFindingState without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.SetFindingStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ); + client.innerApiCalls.setFindingState = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setFindingState( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setFindingState with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.SetFindingStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setFindingState = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setFindingState(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setFindingState with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SetFindingStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.SetFindingStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setFindingState(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('updateFinding', () => { + it('invokes updateFinding without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ); + client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); + const [response] = await client.updateFinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFinding without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ); + client.innerApiCalls.updateFinding = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFinding with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFinding = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateFinding(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFinding with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); + request.finding.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateFinding(request), expectedError); + }); + }); + + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.updateOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOrganizationSettings with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ); + client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); + const [response] = await client.updateSource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSource without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ); + client.innerApiCalls.updateSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSource with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSource with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSource(request), expectedError); + }); + }); + + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSecurityMarks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityMarks without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSecurityMarks( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.ISecurityMarks | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityMarks with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityMarks with closed client', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); + request.securityMarks.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + }); + }); + + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCall(expectedResponse); + const [operation] = await client.runAssetDiscovery(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAssetDiscovery without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runAssetDiscovery( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAssetDiscovery with call error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.runAssetDiscovery(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAssetDiscovery with LRO error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.runAssetDiscovery(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRunAssetDiscoveryProgress without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunAssetDiscoveryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunAssetDiscoveryProgress with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRunAssetDiscoveryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('groupAssets', () => { + it('invokes groupAssets without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); + const [response] = await client.groupAssets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupAssets without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.groupAssets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1beta1.IGroupResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupAssets with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.groupAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.groupAssets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupAssetsStream without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1beta1.GroupResult + ) => { + 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.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes groupAssetsStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1beta1.GroupResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupAssets without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = + []; + const iterable = client.groupAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupAssets with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.groupAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('groupFindings', () => { + it('invokes groupFindings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); + const [response] = await client.groupFindings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupFindings without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.groupFindings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1beta1.IGroupResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupFindings with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.groupFindings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.groupFindings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupFindingsStream without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.groupFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1beta1.GroupResult + ) => { + 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.groupFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupFindings, request) + ); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes groupFindingsStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.groupFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.GroupResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1beta1.GroupResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupFindings, request) + ); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupFindings without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = + []; + const iterable = client.groupFindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupFindings with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.groupFindingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.innerApiCalls.listAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAssets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.descriptors.page.listAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + ) => { + 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.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.descriptors.page.listAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[] = + []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listAssets.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 securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.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 securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + ]; + client.innerApiCalls.listFindings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFindings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1beta1.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 securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.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 securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + ]; + client.descriptors.page.listFindings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.Finding[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1beta1.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 securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.Finding[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1beta1.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 securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Finding() + ), + ]; + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1beta1.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 securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.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.securitycenter.v1beta1.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('listSources', () => { + it('invokes listSources without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + ]; + client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); + const [response] = await client.listSources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSources without error using callback', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + ]; + client.innerApiCalls.listSources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1beta1.ISource[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSources with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSources(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSourcesStream without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + ]; + client.descriptors.page.listSources.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.Source[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1beta1.Source) => { + 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.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSourcesStream with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1beta1.Source[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1beta1.Source) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSources without error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.Source() + ), + ]; + client.descriptors.page.listSources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1beta1.ISource[] = + []; + const iterable = client.listSourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSources with error', async () => { + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1beta1.ISource[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('asset', () => { + const fakePath = '/rendered/path/asset'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.assetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assetPath', () => { + const result = client.assetPath('organizationValue', 'assetValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromAssetName', () => { + const result = client.matchOrganizationFromAssetName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromAssetName', () => { + const result = client.matchAssetFromAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('finding', () => { + const fakePath = '/rendered/path/finding'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + 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( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.findingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromFindingName', () => { + const result = client.matchOrganizationFromFindingName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFindingName', () => { + const result = client.matchSourceFromFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + 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('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationAssetSecurityMarks', () => { + const fakePath = '/rendered/path/organizationAssetSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationAssetSecurityMarksPath', () => { + const result = client.organizationAssetSecurityMarksPath( + 'organizationValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationAssetSecurityMarksName', () => { + const result = + client.matchOrganizationFromOrganizationAssetSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromOrganizationAssetSecurityMarksName', () => { + const result = + client.matchAssetFromOrganizationAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSettings', () => { + const fakePath = '/rendered/path/organizationSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSettingsPath', () => { + const result = client.organizationSettingsPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSettingsName', () => { + const result = + client.matchOrganizationFromOrganizationSettingsName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/organizationSourceFindingSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceFindingSecurityMarksPath', () => { + const result = client.organizationSourceFindingSecurityMarksPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('source', () => { + const fakePath = '/rendered/path/source'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.sourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.sourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('sourcePath', () => { + const result = client.sourcePath('organizationValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.sourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromSourceName', () => { + const result = client.matchOrganizationFromSourceName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.sourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromSourceName', () => { + const result = client.matchSourceFromSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.sourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts new file mode 100644 index 00000000000..9209d73f46f --- /dev/null +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -0,0 +1,5775 @@ +// 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 securitycenterModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1p1beta1.SecurityCenterClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + securitycenterModule.v1p1beta1.SecurityCenterClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + securitycenterModule.v1p1beta1.SecurityCenterClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = securitycenterModule.v1p1beta1.SecurityCenterClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + await client.initialize(); + assert(client.securityCenterStub); + }); + + it('has close method for the initialized client', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.securityCenterStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.securityCenterStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + 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 securitycenterModule.v1p1beta1.SecurityCenterClient({ + 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('createSource', () => { + it('invokes createSource without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ); + client.innerApiCalls.createSource = stubSimpleCall(expectedResponse); + const [response] = await client.createSource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSource without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ); + client.innerApiCalls.createSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSource with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSource with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSource(request), expectedError); + }); + }); + + describe('createFinding', () => { + it('invokes createFinding without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Finding() + ); + client.innerApiCalls.createFinding = stubSimpleCall(expectedResponse); + const [response] = await client.createFinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFinding without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Finding() + ); + client.innerApiCalls.createFinding = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFinding with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFinding = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createFinding(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFinding with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createFinding(request), expectedError); + }); + }); + + describe('createNotificationConfig', () => { + it('invokes createNotificationConfig without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ); + client.innerApiCalls.createNotificationConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.createNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ); + client.innerApiCalls.createNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNotificationConfig with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createNotificationConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createNotificationConfig(request), + expectedError + ); + }); + }); + + describe('deleteNotificationConfig', () => { + it('invokes deleteNotificationConfig without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteNotificationConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteNotificationConfig( + 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.deleteNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNotificationConfig with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteNotificationConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteNotificationConfig(request), + expectedError + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('getNotificationConfig', () => { + it('invokes getNotificationConfig without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ); + client.innerApiCalls.getNotificationConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.getNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ); + client.innerApiCalls.getNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNotificationConfig with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getNotificationConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getNotificationConfig(request), + expectedError + ); + }); + }); + + describe('getOrganizationSettings', () => { + it('invokes getOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() + ); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.getOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() + ); + client.innerApiCalls.getOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganizationSettings with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getOrganizationSettings(request), + expectedError + ); + }); + }); + + describe('getSource', () => { + it('invokes getSource without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ); + client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); + const [response] = await client.getSource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSource without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ); + client.innerApiCalls.getSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSource with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSource with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSource(request), expectedError); + }); + }); + + describe('setFindingState', () => { + it('invokes setFindingState without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Finding() + ); + client.innerApiCalls.setFindingState = stubSimpleCall(expectedResponse); + const [response] = await client.setFindingState(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setFindingState without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Finding() + ); + client.innerApiCalls.setFindingState = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setFindingState( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setFindingState with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setFindingState = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setFindingState(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setFindingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setFindingState with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setFindingState(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('updateFinding', () => { + it('invokes updateFinding without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Finding() + ); + client.innerApiCalls.updateFinding = stubSimpleCall(expectedResponse); + const [response] = await client.updateFinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFinding without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Finding() + ); + client.innerApiCalls.updateFinding = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFinding with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); + request.finding.name = defaultValue1; + const expectedHeaderRequestParams = `finding.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFinding = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateFinding(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFinding with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest() + ); + request.finding ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest', + ['finding', 'name'] + ); + request.finding.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateFinding(request), expectedError); + }); + }); + + describe('updateNotificationConfig', () => { + it('invokes updateNotificationConfig without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ); + client.innerApiCalls.updateNotificationConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateNotificationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNotificationConfig without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ); + client.innerApiCalls.updateNotificationConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateNotificationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNotificationConfig with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `notification_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNotificationConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateNotificationConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNotificationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNotificationConfig with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest() + ); + request.notificationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest', + ['notificationConfig', 'name'] + ); + request.notificationConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateNotificationConfig(request), + expectedError + ); + }); + }); + + describe('updateOrganizationSettings', () => { + it('invokes updateOrganizationSettings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.updateOrganizationSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOrganizationSettings without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.OrganizationSettings() + ); + client.innerApiCalls.updateOrganizationSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateOrganizationSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.IOrganizationSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOrganizationSettings with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedHeaderRequestParams = `organization_settings.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOrganizationSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateOrganizationSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOrganizationSettings with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest() + ); + request.organizationSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest', + ['organizationSettings', 'name'] + ); + request.organizationSettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateOrganizationSettings(request), + expectedError + ); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ); + client.innerApiCalls.updateSource = stubSimpleCall(expectedResponse); + const [response] = await client.updateSource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSource without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ); + client.innerApiCalls.updateSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSource with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSource with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSource(request), expectedError); + }); + }); + + describe('updateSecurityMarks', () => { + it('invokes updateSecurityMarks without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSecurityMarks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityMarks without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.SecurityMarks() + ); + client.innerApiCalls.updateSecurityMarks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSecurityMarks( + request, + ( + err?: Error | null, + result?: protos.google.cloud.securitycenter.v1p1beta1.ISecurityMarks | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityMarks with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); + request.securityMarks.name = defaultValue1; + const expectedHeaderRequestParams = `security_marks.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecurityMarks = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSecurityMarks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityMarks with closed client', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest() + ); + request.securityMarks ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest', + ['securityMarks', 'name'] + ); + request.securityMarks.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSecurityMarks(request), expectedError); + }); + }); + + describe('runAssetDiscovery', () => { + it('invokes runAssetDiscovery without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCall(expectedResponse); + const [operation] = await client.runAssetDiscovery(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAssetDiscovery without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runAssetDiscovery = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runAssetDiscovery( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.securitycenter.v1p1beta1.IRunAssetDiscoveryResponse, + protos.google.protobuf.IEmpty + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAssetDiscovery with call error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.runAssetDiscovery(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runAssetDiscovery with LRO error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runAssetDiscovery = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.runAssetDiscovery(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runAssetDiscovery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRunAssetDiscoveryProgress without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunAssetDiscoveryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunAssetDiscoveryProgress with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRunAssetDiscoveryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('groupAssets', () => { + it('invokes groupAssets without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = stubSimpleCall(expectedResponse); + const [response] = await client.groupAssets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupAssets without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.groupAssets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupAssets with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.groupAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.groupAssets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupAssetsStream without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.GroupResult + ) => { + 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.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes groupAssetsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.groupAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.GroupResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupAssets, request) + ); + assert( + (client.descriptors.page.groupAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupAssets without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = + []; + const iterable = client.groupAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupAssets with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.groupAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.groupAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.groupAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('groupFindings', () => { + it('invokes groupFindings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = stubSimpleCall(expectedResponse); + const [response] = await client.groupFindings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupFindings without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.innerApiCalls.groupFindings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.groupFindings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupFindings with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.groupFindings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.groupFindings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.groupFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes groupFindingsStream without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.groupFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.GroupResult + ) => { + 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.groupFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupFindings, request) + ); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes groupFindingsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.groupFindings.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.groupFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.GroupResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.GroupResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.groupFindings, request) + ); + assert( + (client.descriptors.page.groupFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupFindings without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupResult() + ), + ]; + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = + []; + const iterable = client.groupFindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with groupFindings with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.groupFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.groupFindingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.groupFindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.groupFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.innerApiCalls.listAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAssets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.descriptors.page.listAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + ) => { + 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.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult() + ), + ]; + client.descriptors.page.listAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[] = + []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listAssets.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 securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + ]; + 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 securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.innerApiCalls.listFindings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFindings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[] + | 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 securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.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 securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.descriptors.page.listFindings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + ) => { + 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 securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult + ) => { + 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 securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult() + ), + ]; + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[] = + []; + 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 securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.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.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[] = + []; + 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('listNotificationConfigs', () => { + it('invokes listNotificationConfigs without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + ]; + client.innerApiCalls.listNotificationConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listNotificationConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNotificationConfigs without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + ]; + client.innerApiCalls.listNotificationConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNotificationConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNotificationConfigs with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNotificationConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listNotificationConfigs(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNotificationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNotificationConfigsStream without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + ]; + client.descriptors.page.listNotificationConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listNotificationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig + ) => { + 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.listNotificationConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listNotificationConfigs, request) + ); + assert( + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listNotificationConfigsStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNotificationConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listNotificationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listNotificationConfigs, request) + ); + assert( + ( + client.descriptors.page.listNotificationConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNotificationConfigs without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.NotificationConfig() + ), + ]; + client.descriptors.page.listNotificationConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[] = + []; + const iterable = client.listNotificationConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNotificationConfigs with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNotificationConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNotificationConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listNotificationConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSources', () => { + it('invokes listSources without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + ]; + client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); + const [response] = await client.listSources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSources without error using callback', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + ]; + client.innerApiCalls.listSources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSources( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.securitycenter.v1p1beta1.ISource[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSources with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSources(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSourcesStream without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + ]; + client.descriptors.page.listSources.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.Source[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1p1beta1.Source) => { + 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.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSourcesStream with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.Source[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.securitycenter.v1p1beta1.Source) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSources without error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.Source() + ), + ]; + client.descriptors.page.listSources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.securitycenter.v1p1beta1.ISource[] = + []; + const iterable = client.listSourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSources with error', async () => { + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.securitycenter.v1p1beta1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.securitycenter.v1p1beta1.ISource[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('folderAsset', () => { + const fakePath = '/rendered/path/folderAsset'; + const expectedParameters = { + folder: 'folderValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderAssetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderAssetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderAssetPath', () => { + const result = client.folderAssetPath('folderValue', 'assetValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderAssetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderAssetName', () => { + const result = client.matchFolderFromFolderAssetName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromFolderAssetName', () => { + const result = client.matchAssetFromFolderAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.folderAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderAssetSecurityMarks', () => { + const fakePath = '/rendered/path/folderAssetSecurityMarks'; + const expectedParameters = { + folder: 'folderValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderAssetSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderAssetSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderAssetSecurityMarksPath', () => { + const result = client.folderAssetSecurityMarksPath( + 'folderValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderAssetSecurityMarksName', () => { + const result = + client.matchFolderFromFolderAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromFolderAssetSecurityMarksName', () => { + const result = + client.matchAssetFromFolderAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.folderAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSource', () => { + const fakePath = '/rendered/path/folderSource'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSourcePath', () => { + const result = client.folderSourcePath('folderValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderSourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceName', () => { + const result = client.matchFolderFromFolderSourceName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceName', () => { + const result = client.matchSourceFromFolderSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.folderSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSourceFinding', () => { + const fakePath = '/rendered/path/folderSourceFinding'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourceFindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSourceFindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSourceFindingPath', () => { + const result = client.folderSourceFindingPath( + 'folderValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceFindingName', () => { + const result = client.matchFolderFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceFindingName', () => { + const result = client.matchSourceFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFolderSourceFindingName', () => { + const result = client.matchFindingFromFolderSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.folderSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/folderSourceFindingSecurityMarks'; + const expectedParameters = { + folder: 'folderValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSourceFindingSecurityMarksPath', () => { + const result = client.folderSourceFindingSecurityMarksPath( + 'folderValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchFolderFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFolderSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromFolderSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.folderSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notificationConfig', () => { + const fakePath = '/rendered/path/notificationConfig'; + const expectedParameters = { + organization: 'organizationValue', + notification_config: 'notificationConfigValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notificationConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notificationConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notificationConfigPath', () => { + const result = client.notificationConfigPath( + 'organizationValue', + 'notificationConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.notificationConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromNotificationConfigName', () => { + const result = + client.matchOrganizationFromNotificationConfigName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.notificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotificationConfigFromNotificationConfigName', () => { + const result = + client.matchNotificationConfigFromNotificationConfigName(fakePath); + assert.strictEqual(result, 'notificationConfigValue'); + assert( + ( + client.pathTemplates.notificationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationAsset', () => { + const fakePath = '/rendered/path/organizationAsset'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationAssetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationAssetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationAssetPath', () => { + const result = client.organizationAssetPath( + 'organizationValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationAssetName', () => { + const result = + client.matchOrganizationFromOrganizationAssetName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromOrganizationAssetName', () => { + const result = client.matchAssetFromOrganizationAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.organizationAssetPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationAssetSecurityMarks', () => { + const fakePath = '/rendered/path/organizationAssetSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationAssetSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationAssetSecurityMarksPath', () => { + const result = client.organizationAssetSecurityMarksPath( + 'organizationValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationAssetSecurityMarksName', () => { + const result = + client.matchOrganizationFromOrganizationAssetSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromOrganizationAssetSecurityMarksName', () => { + const result = + client.matchAssetFromOrganizationAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.organizationAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSettings', () => { + const fakePath = '/rendered/path/organizationSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSettingsPath', () => { + const result = client.organizationSettingsPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSettingsName', () => { + const result = + client.matchOrganizationFromOrganizationSettingsName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSource', () => { + const fakePath = '/rendered/path/organizationSource'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSourcePath', () => { + const result = client.organizationSourcePath( + 'organizationValue', + 'sourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSourcePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceName', () => { + const result = + client.matchOrganizationFromOrganizationSourceName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceName', () => { + const result = client.matchSourceFromOrganizationSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.organizationSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSourceFinding', () => { + const fakePath = '/rendered/path/organizationSourceFinding'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourceFindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSourceFindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSourceFindingPath', () => { + const result = client.organizationSourceFindingPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceFindingName', () => { + const result = + client.matchOrganizationFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingName', () => { + const result = + client.matchSourceFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingName', () => { + const result = + client.matchFindingFromOrganizationSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.organizationSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/organizationSourceFindingSecurityMarks'; + const expectedParameters = { + organization: 'organizationValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSourceFindingSecurityMarksPath', () => { + const result = client.organizationSourceFindingSecurityMarksPath( + 'organizationValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchOrganizationFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromOrganizationSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromOrganizationSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates + .organizationSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAsset', () => { + const fakePath = '/rendered/path/projectAsset'; + const expectedParameters = { + project: 'projectValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAssetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAssetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAssetPath', () => { + const result = client.projectAssetPath('projectValue', 'assetValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAssetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAssetName', () => { + const result = client.matchProjectFromProjectAssetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromProjectAssetName', () => { + const result = client.matchAssetFromProjectAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.projectAssetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAssetSecurityMarks', () => { + const fakePath = '/rendered/path/projectAssetSecurityMarks'; + const expectedParameters = { + project: 'projectValue', + asset: 'assetValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAssetSecurityMarksPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAssetSecurityMarksPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAssetSecurityMarksPath', () => { + const result = client.projectAssetSecurityMarksPath( + 'projectValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAssetSecurityMarksName', () => { + const result = + client.matchProjectFromProjectAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromProjectAssetSecurityMarksName', () => { + const result = + client.matchAssetFromProjectAssetSecurityMarksName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.projectAssetSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSource', () => { + const fakePath = '/rendered/path/projectSource'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSourcePath', () => { + const result = client.projectSourcePath('projectValue', 'sourceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectSourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceName', () => { + const result = client.matchProjectFromProjectSourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceName', () => { + const result = client.matchSourceFromProjectSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.projectSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSourceFinding', () => { + const fakePath = '/rendered/path/projectSourceFinding'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourceFindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSourceFindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSourceFindingPath', () => { + const result = client.projectSourceFindingPath( + 'projectValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceFindingName', () => { + const result = + client.matchProjectFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceFindingName', () => { + const result = client.matchSourceFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromProjectSourceFindingName', () => { + const result = + client.matchFindingFromProjectSourceFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.projectSourceFindingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectSourceFindingSecurityMarks', () => { + const fakePath = '/rendered/path/projectSourceFindingSecurityMarks'; + const expectedParameters = { + project: 'projectValue', + source: 'sourceValue', + finding: 'findingValue', + }; + const client = new securitycenterModule.v1p1beta1.SecurityCenterClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSourceFindingSecurityMarksPath', () => { + const result = client.projectSourceFindingSecurityMarksPath( + 'projectValue', + 'sourceValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchProjectFromProjectSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchSourceFromProjectSourceFindingSecurityMarksName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromProjectSourceFindingSecurityMarksName', () => { + const result = + client.matchFindingFromProjectSourceFindingSecurityMarksName( + fakePath + ); + assert.strictEqual(result, 'findingValue'); + assert( + ( + client.pathTemplates.projectSourceFindingSecurityMarksPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-securitycenter/tsconfig.json b/packages/google-cloud-securitycenter/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-securitycenter/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-securitycenter/webpack.config.js b/packages/google-cloud-securitycenter/webpack.config.js new file mode 100644 index 00000000000..2f070bdcbd4 --- /dev/null +++ b/packages/google-cloud-securitycenter/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: 'SecurityCenter', + filename: './security-center.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', +};